Documentation
¶
Overview ¶
Package admin is the local unix-socket administration API used by the CLI while the agent holds its lock.
Index ¶
- Constants
- func Handler(b Backend) http.Handler
- func Serve(ctx context.Context, dir string, b Backend) error
- type Backend
- type Client
- func (c *Client) Commit(ctx context.Context, r CommitReceipt) error
- func (c *Client) Deenroll(ctx context.Context, reason string) error
- func (c *Client) Export(ctx context.Context, fromSeq uint64, w io.Writer) error
- func (c *Client) Investigate(ctx context.Context, req InvestigateRequest) (json.RawMessage, error)
- func (c *Client) Status(ctx context.Context) (json.RawMessage, error)
- type CommitReceipt
- type InvestigateRequest
Constants ¶
View Source
const SocketName = "admin.sock"
SocketName is the socket file name inside the state directory.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface {
Status(ctx context.Context) (any, error)
Investigate(ctx context.Context, req InvestigateRequest) (any, error)
// Export writes an export file (protocol.ExportWriter format) of spooled records above fromSeq.
Export(ctx context.Context, fromSeq uint64, w io.Writer) error
Deenroll(ctx context.Context, reason string) error
Commit(ctx context.Context, r CommitReceipt) error
}
Backend is implemented by each role.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to a running agent's admin socket.
func (*Client) Commit ¶
func (c *Client) Commit(ctx context.Context, r CommitReceipt) error
Commit applies an air-gap commit receipt.
func (*Client) Investigate ¶
func (c *Client) Investigate(ctx context.Context, req InvestigateRequest) (json.RawMessage, error)
Investigate runs a tool and returns its JSON result.
type CommitReceipt ¶
type CommitReceipt struct {
Epoch string `json:"epoch"`
Seq uint64 `json:"seq"`
ChainHash string `json:"chain_hash"`
}
CommitReceipt is an air-gap import receipt confirming the committed head.
type InvestigateRequest ¶
type InvestigateRequest struct {
Tool string `json:"tool"`
Args json.RawMessage `json:"args"`
}
InvestigateRequest runs one investigation tool locally.
Click to show internal directories.
Click to hide internal directories.