Documentation
¶
Overview ¶
Package cmd has the heartbeats' commands and flags
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCommands ¶
type ClientCommands struct {
HeartbeatCommands
}
ClientCommands are the commands which call the heartbeats' API
type Flags ¶
type Flags struct{}
Flags are the heartbeats' flags for the server, which has none yet
func (Flags) WithHeartbeats ¶
func (flags Flags) WithHeartbeats(ctx server.Cmd, srv *servercmd.RunServer, store heartbeat.Store, fn func(*heartbeat.Heartbeats) error, opts ...heartbeat.Opt) error
WithHeartbeats creates the heartbeats, in the store, with the options, such as the broadcaster they publish their changes to, and the person's time zone, registers their HTTP handlers with the server, when there is one, and then calls the function with them, returning any error. The function adds them to a toolkit, so models can schedule them, and runs them, so they fire.
type HeartbeatCmd ¶
type HeartbeatCmd struct {
ID string `arg:"" name:"id" help:"Identifier of the heartbeat."`
}
type HeartbeatCommands ¶
type HeartbeatCommands struct {
Heartbeats HeartbeatsCmd `cmd:"" name:"heartbeats" help:"List the heartbeats, which fire soonest first." group:"HEARTBEAT"`
Heartbeat HeartbeatCmd `cmd:"" name:"heartbeat" help:"Print a heartbeat." group:"HEARTBEAT"`
HeartbeatCreate HeartbeatCreateCmd `` /* 179-byte string literal not displayed */
HeartbeatUpdate HeartbeatUpdateCmd `cmd:"" name:"heartbeat-update" help:"Change a heartbeat's title, prompt, time, schedule or time zone." group:"HEARTBEAT"`
HeartbeatDelete HeartbeatDeleteCmd `cmd:"" name:"heartbeat-delete" help:"Delete a heartbeat." group:"HEARTBEAT"`
}
HeartbeatCommands are the commands which list, get, create, change and delete the heartbeats
type HeartbeatCreateCmd ¶
type HeartbeatCreateCmd struct {
Prompt []string `` /* 154-byte string literal not displayed */
Session string `name:"session" required:"" help:"Identifier of the session which the prompt is for."`
Title string `name:"title" short:"t" required:"" help:"What it's for, in a few words."`
Schedule string `name:"schedule" help:"When it fires, again and again, as a cron expression, such as '0 8 * * 1-5'."`
At string `name:"at" help:"When it fires, once, such as 2026-11-06T15:00, in local time, or with an offset."`
Timezone string `name:"timezone" help:"Time zone of the schedule, such as Europe/Berlin, or none, for the person's."`
}
type HeartbeatDeleteCmd ¶
type HeartbeatDeleteCmd struct {
ID string `arg:"" name:"id" help:"Identifier of the heartbeat."`
}
type HeartbeatUpdateCmd ¶
type HeartbeatUpdateCmd struct {
ID string `arg:"" name:"id" help:"Identifier of the heartbeat."`
Title *string `name:"title" short:"t" help:"What it's for, in a few words."`
Prompt *string `name:"prompt" help:"The instruction for the model, when it fires."`
Schedule *string `name:"schedule" help:"When it fires, again and again, as a cron expression, which replaces its time."`
At string `name:"at" help:"When it fires, once, which replaces its schedule, in local time, or with an offset."`
Timezone *string `name:"timezone" help:"Time zone of its schedule, or empty, for the person's."`
}