Documentation ¶
Overview ¶
Package agentapi provides an API for interacting with the agent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultSocketPath ¶
DefaultSocketPath constructs the default path for the Agent API socket.
func LeaderPath ¶
LeaderPath returns the path to the socket pointing to the leader agent.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the agent API socket.
func NewClient ¶
NewClient creates a new Client using the socket at a given path. The context is used for an internal check that the socket can be dialled.
func (*Client) LockCompareAndSwap ¶
func (c *Client) LockCompareAndSwap(ctx context.Context, key, old, new string) (string, bool, error)
LockCompareAndSwap atomically compares-and-swaps the old value for the new value, or performs no modification. It returns the most up-to-date value for the key, and reports whether the new value was written.
type LockCASRequest ¶
LockCASRequest is the request body for the PATCH /lock/{key} endpoint.
type LockCASResponse ¶
LockCASResponse is the response body for the PATCH /lock/{key} endpoint.
type PingResponse ¶
PingResponse is the response body for the ping endpoint.
type ValueResponse ¶
type ValueResponse struct {
Value string `json:"value"`
}
ValueResponse is the response body for endpoints that return a single value.