Documentation
¶
Overview ¶
Package localapi is the agent's local control socket, used by the CLI.
Index ¶
Constants ¶
View Source
const SocketName = "transporter.sock"
SocketName is the socket's file name inside the state directory.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface {
Status() Status
Shutdown()
// Ping probes target (a peer name or mesh IP), calling fn per result,
// and returns the address it resolved target to.
Ping(ctx context.Context, target string, count int, timeout time.Duration, fn func(pingsvc.Result)) (netip.Addr, error)
}
Backend provides the data the API serves.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to a running agent.
func (*Client) Ping ¶
func (c *Client) Ping(ctx context.Context, target string, count int, timeout time.Duration, fn func(PingResult)) error
Ping asks the agent to probe target, calling fn for each result line as it arrives. The final line carries the resolved address; a line with only an error means the ping could not start.
Click to show internal directories.
Click to hide internal directories.