MCPcopy
hub / github.com/digitalocean/doctl / Call

Method Call

pluginhost/plugin.go:46–60  ·  view source on GitHub ↗

Call a method on the plugin.

(method string, args ...string)

Source from the content-addressed store, hash-verified

44
45// Call a method on the plugin.
46func (h *Host) Call(method string, args ...string) (string, error) {
47 opts := &CallOptions{
48 AccessToken: viper.GetString(doctl.ArgAccessToken),
49 Args: args,
50 }
51
52 var result string
53 err := h.client.Call(method, opts, &result)
54 if err != nil {
55 debug(err.Error())
56 return "", fmt.Errorf("unable to run plugin action %s", method)
57 }
58
59 return result, nil
60}
61
62func debug(msg string) {
63 //if viper.GetBool("verbose") {

Callers 15

RunPluginRunFunction · 0.95
GetMethod · 0.80
GetMethod · 0.80
AddAgentRouteMethod · 0.80
CancelIndexingJobMethod · 0.80
CreateAgentMethod · 0.80
CreateAgentAPIKeyMethod · 0.80
CreateFunctionRouteMethod · 0.80
CreateKnowledgeBaseMethod · 0.80
CreateOpenAIAPIKeyMethod · 0.80

Calls 4

debugFunction · 0.85
ErrorfMethod · 0.80
GetStringMethod · 0.65
ErrorMethod · 0.45

Tested by 2

GetMethod · 0.64
GetMethod · 0.64