apiclient

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 25 Imported by: 0 modules, 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 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

Constants

This section is empty.

Variables

View Source
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

func Err(err error, w, ew io.Writer) error

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

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.

func Print

func Print(w, ew io.Writer, p *f10v1.Printed)

Print writes p's stdout to w and its stderr to ew, stderr first: it holds what the call reported while it worked.

func View

func View(raw []byte, v any) error

View reads a read reply's view into v.

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

func Dial(ctx context.Context) (*Clients, error)

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

func (c *Clients) BareCaller(cmd *cli.Command) (*f10v1.CallerContext, error)

BareCaller is Caller without the -C checkout, for a command that takes several and sends them itself.

func (*Clients) Caller

func (c *Clients) Caller(cmd *cli.Command) (*f10v1.CallerContext, error)

Caller is where cmd runs, for a request's caller context: its directory and -C checkout, its session and workspace, its environment when the handlers run in the daemon, and whether its output is a terminal.

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.

func (InProcess) Remember

func (InProcess) Remember([]string)

func (InProcess) ResumeDrive

func (InProcess) ResumeDrive(string, string, []string, int) (daemon.Started, error)

func (InProcess) RunDrive

func (InProcess) SessionEnv

func (InProcess) SessionEnv() []string

func (InProcess) Status

func (InProcess) Status() daemon.Status

func (InProcess) WatchProject

func (InProcess) WatchProject(string, string, []string) (string, error)

Jump to

Keyboard shortcuts

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