Documentation
¶
Index ¶
- type Client
- func (c *Client) AgentStatus(ctx context.Context) ([]*protopkg.AgentStatus, error)
- func (c *Client) GetLogs(ctx context.Context, agentID string) (<-chan string, error)
- func (c *Client) Lifecycle(ctx context.Context, agentIDs []string, ...) []Result
- func (c *Client) LifecycleWithOpts(ctx context.Context, agentIDs []string, ...) []Result
- func (c *Client) Ping(ctx context.Context) (string, error)
- func (c *Client) ReloadAgents(ctx context.Context) error
- func (c *Client) Shutdown(ctx context.Context, action string) error
- func (c *Client) Start(ctx context.Context, agentIDs []string) []Result
- func (c *Client) StartWithOpts(ctx context.Context, agentIDs []string, opts LifecycleOptions) []Result
- func (c *Client) Stop(ctx context.Context, agentIDs []string) []Result
- type LifecycleOptions
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a programmatic interface to interact with a running GAPI daemon.
func NewFromBus ¶
NewFromBus creates a new Client using an existing EventBus (for in-process use).
func (*Client) AgentStatus ¶
AgentStatus queries the daemon for the status of all agents.
func (*Client) GetLogs ¶
GetLogs subscribes to the logs for a specific agent and returns a channel of log lines. The subscription is automatically cleaned up when the context is cancelled.
func (*Client) Lifecycle ¶
func (c *Client) Lifecycle(ctx context.Context, agentIDs []string, action protopkg.LifecycleControl_Action) []Result
Lifecycle sends a lifecycle action to a set of agents and waits for their transition.
func (*Client) LifecycleWithOpts ¶
func (c *Client) LifecycleWithOpts(ctx context.Context, agentIDs []string, action protopkg.LifecycleControl_Action, opts LifecycleOptions) []Result
LifecycleWithOpts sends a lifecycle action with options.
func (*Client) ReloadAgents ¶
ReloadAgents triggers a reload of the agent registry on the daemon.
func (*Client) Shutdown ¶
Shutdown requests a system shutdown from the daemon. action is one of "poweroff", "reboot", "halt" (the topic's documented payload vocabulary); in PID-1 mode the daemon answers with the full init teardown.
func (*Client) StartWithOpts ¶
func (c *Client) StartWithOpts(ctx context.Context, agentIDs []string, opts LifecycleOptions) []Result
StartWithOpts triggers the START action with options.
type LifecycleOptions ¶
LifecycleOptions defines optional parameters for lifecycle actions.