cmd

package
v1.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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."`
}

func (*HeartbeatCmd) Run

func (cmd *HeartbeatCmd) Run(ctx server.Cmd) error

Run prints 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."`
}

func (*HeartbeatCreateCmd) Run

func (cmd *HeartbeatCreateCmd) Run(ctx server.Cmd) error

Run creates the heartbeat, and prints it

type HeartbeatDeleteCmd

type HeartbeatDeleteCmd struct {
	ID string `arg:"" name:"id" help:"Identifier of the heartbeat."`
}

func (*HeartbeatDeleteCmd) Run

func (cmd *HeartbeatDeleteCmd) Run(ctx server.Cmd) error

Run deletes the heartbeat, and prints it, as it was

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."`
}

func (*HeartbeatUpdateCmd) Run

func (cmd *HeartbeatUpdateCmd) Run(ctx server.Cmd) error

Run changes the heartbeat, and prints it

type HeartbeatsCmd

type HeartbeatsCmd struct {
	Session string  `name:"session" help:"Identifier of the session whose heartbeats are listed."`
	Offset  uint64  `name:"offset" help:"How many heartbeats to skip."`
	Limit   *uint64 `name:"limit" help:"Most heartbeats to list."`
}

func (*HeartbeatsCmd) Run

func (cmd *HeartbeatsCmd) Run(ctx server.Cmd) error

Run prints the heartbeats, as a table, and how many there are

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL