Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SpaceGetFieldCmd = &cli.Command{ Name: "get-field", Usage: "Get a Custom Field", Description: "Get a custom field value from the space.", Arguments: []cli.Argument{ &cli.StringArg{ Name: "name", Usage: "The name of the custom field to get", Required: true, }, }, MaxArgs: cli.NoArgs, Run: func(ctx context.Context, cmd *cli.Command) error { varRequest := agentlink.SpaceGetFieldRequest{ Name: cmd.GetStringArg("name"), } var response agentlink.SpaceGetFieldResponse err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceGetField, &varRequest, &response) if err != nil { return fmt.Errorf("error getting custom field: %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 SpaceSetFieldCmd = &cli.Command{ Name: "set-field", Usage: "Set a Custom Field", Description: "Set a custom field value for the space.", Arguments: []cli.Argument{ &cli.StringArg{ Name: "name", Usage: "The name of the custom field 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.SpaceFieldRequest{ Name: cmd.GetStringArg("name"), Value: cmd.GetStringArg("value"), } err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceSetField, &varRequest, nil) if err != nil { return fmt.Errorf("error setting custom field: %w", err) } fmt.Println("Custom field set.") 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 }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.