Documentation
¶
Overview ¶
Package apiclient is how f10's control-plane commands reach the API: the daemon on its unix socket, started when none runs, or the same handlers served in this process where no daemon runs (off unix) and in tests.
Index ¶
- Variables
- func Err(err error, w, ew io.Writer) error
- func InboxIn(dir string, d agents.Deliverer) agentsv1connect.InboxServiceClient
- func Print(w, ew io.Writer, p *f10v1.Printed)
- func View(raw []byte, v any) error
- type Clients
- type InProcess
- func (InProcess) Remember([]string)
- func (InProcess) ResumeDrive(string, string, []string, int) (daemon.Started, error)
- func (InProcess) RunDrive(daemon.DriveSpec) (daemon.Started, error)
- func (InProcess) SessionEnv() []string
- func (InProcess) Status() daemon.Status
- func (InProcess) WatchProject(string, string, []string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var Local func() http.Handler
Local serves the API in this process, over InProcess: the binary sets it, since the handlers sit above every command that calls them.
Functions ¶
func Err ¶
Err is err as the command returns it, once what the call printed before failing is written: the daemon's sentence without Connect's code, and the exit code the command exited with in process.
func InboxIn ¶ added in v0.67.0
func InboxIn(dir string, d agents.Deliverer) agentsv1connect.InboxServiceClient
InboxIn is a client of the inbox in dir with d moving answers on, served in process: what a test of the inbox command calls instead of the daemon's inbox.
Types ¶
type Clients ¶
type Clients struct {
Runs f10v1connect.RunServiceClient
Tasks f10v1connect.TaskServiceClient
Board f10v1connect.BoardServiceClient
Agents agentsv1connect.AgentServiceClient
Inbox agentsv1connect.InboxServiceClient
// contains filtered or unexported fields
}
Clients are the generated clients of every service a command calls.
func Dial ¶
Dial is the clients of this user's daemon, started when none runs; in a test binary, or where no daemon runs, the handlers served in process.
func (*Clients) AgentsCaller ¶
func (c *Clients) AgentsCaller(cmd *cli.Command) *agentsv1.CallerContext
AgentsCaller is the agents.v1 caller context for cmd.
func (*Clients) BareCaller ¶
BareCaller is Caller without the -C checkout, for a command that takes several and sends them itself.
type InProcess ¶
type InProcess struct{}
InProcess is the supervisor of handlers served in this process: no daemon runs drives or watches here, and Herdr is this process's own.