Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SpaceGetVarCmd = &cli.Command{ Name: "get-var", Usage: "Get a Variable", Description: "Get a custom field variable value from the space.", Arguments: []cli.Argument{ &cli.StringArg{ Name: "name", Usage: "The name of the variable to get", Required: true, }, }, MaxArgs: cli.NoArgs, Run: func(ctx context.Context, cmd *cli.Command) error { varRequest := agentlink.SpaceGetVarRequest{ Name: cmd.GetStringArg("name"), } var response agentlink.SpaceGetVarResponse err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceGetVar, &varRequest, &response) if err != nil { return fmt.Errorf("error getting space variable: %w", err) } fmt.Println(response.Value) return nil }, }
View Source
var SpaceNoteCmd = &cli.Command{ Name: "set-note", Usage: "Set a Note", Description: "Set the runtime note of the space. Allows a note to be written for the space which is shown on the dashboard along with the user entered description.", Arguments: []cli.Argument{ &cli.StringArg{ Name: "note", Usage: "The note text to set", Required: true, }, }, MaxArgs: cli.NoArgs, Run: func(ctx context.Context, cmd *cli.Command) error { noteRequest := agentlink.SpaceNoteRequest{ Note: cmd.GetStringArg("note"), } err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceNote, ¬eRequest, nil) if err != nil { return fmt.Errorf("error setting space note: %w", err) } fmt.Println("Space note set.") return nil }, }
View Source
var SpaceRestartCmd = &cli.Command{ Name: "restart", Usage: "Restart this space", Description: "Restart the space calling this command.", MaxArgs: cli.NoArgs, Run: func(ctx context.Context, cmd *cli.Command) error { err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceRestart, nil, nil) if err != nil { return fmt.Errorf("error requesting space restart: %w", err) } fmt.Println("Restart requested.") return nil }, }
View Source
var SpaceShutdownCmd = &cli.Command{ Name: "shutdown", Usage: "Shutdown this space", Description: "Shutdown the space calling this command.", MaxArgs: cli.NoArgs, Run: func(ctx context.Context, cmd *cli.Command) error { err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceStop, nil, nil) if err != nil { return fmt.Errorf("error requesting space shutdown: %w", err) } fmt.Println("Shutdown requested.") return nil }, }
View Source
var SpaceVarCmd = &cli.Command{ Name: "set-var", Usage: "Set a Variable", Description: "Set a custom field variable value for the space.", Arguments: []cli.Argument{ &cli.StringArg{ Name: "name", Usage: "The name of the variable to set", Required: true, }, &cli.StringArg{ Name: "value", Usage: "The value to set", Required: true, }, }, MaxArgs: cli.NoArgs, Run: func(ctx context.Context, cmd *cli.Command) error { varRequest := agentlink.SpaceVarRequest{ Name: cmd.GetStringArg("name"), Value: cmd.GetStringArg("value"), } err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceVar, &varRequest, nil) if err != nil { return fmt.Errorf("error setting space variable: %w", err) } fmt.Println("Space variable set.") return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.