MCPcopy Create free account
hub / github.com/cloudwan/gohan / getCustomCommands

Method getCustomCommands

cli/client/commands.go:209–219  ·  view source on GitHub ↗

Assumes gohan client is called as follows: gohan client [common_params...] [action_input] [resource_id] where common_params are in form '--name value' and 'name' exists in commonParams action_input conforms to action's InputSchema specification resource_id is ID of the resource this action acts upon

(s *schema.Schema)

Source from the content-addressed store, hash-verified

207// action_input conforms to action's InputSchema specification
208// resource_id is ID of the resource this action acts upon
209func (gohanClientCLI *GohanClientCLI) getCustomCommands(s *schema.Schema) []gohanCommand {
210 ret := make([]gohanCommand, 0, len(s.Actions))
211 for _, act := range s.Actions {
212 ret = append(ret, gohanCommand{
213 Name: s.ID + " " + act.ID,
214 Schema: s,
215 Action: gohanClientCLI.createActionFunc(act, s),
216 })
217 }
218 return ret
219}
220
221func (gohanClientCLI *GohanClientCLI) createActionFunc(
222 act schema.Action,

Callers 2

getCommandsMethod · 0.95
client_test.goFile · 0.80

Calls 1

createActionFuncMethod · 0.95

Tested by

no test coverage detected