rc: add NeedsResponse for rc calls

This commit is contained in:
Chaitanya Bankanhal
2020-07-27 23:31:35 +05:30
committed by Nick Craig-Wood
parent 4884bee8ba
commit 1cae4152f9
3 changed files with 29 additions and 7 deletions

View File

@@ -17,12 +17,13 @@ type Func func(ctx context.Context, in Params) (out Params, err error)
// Call defines info about a remote control function and is used in
// the Add function to create new entry points.
type Call struct {
Path string // path to activate this RC
Fn Func `json:"-"` // function to call
Title string // help for the function
AuthRequired bool // if set then this call requires authorisation to be set
Help string // multi-line markdown formatted help
NeedsRequest bool // if set then this call will be passed the original request object as _request
Path string // path to activate this RC
Fn Func `json:"-"` // function to call
Title string // help for the function
AuthRequired bool // if set then this call requires authorisation to be set
Help string // multi-line markdown formatted help
NeedsRequest bool // if set then this call will be passed the original request object as _request
NeedsResponse bool // if set then this call will be passed the original response object as _response
}
// Registry holds the list of all the registered remote control functions