Documentation ¶
Overview ¶
Package agent provides a CDPI agent implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoActiveServices = errors.New("no services configured for node")
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is a CDPI agent that coordinates change requests across multiple nodes.
func NewAgent ¶
func NewAgent(opts ...AgentOption) (*Agent, error)
NewAgent creates a new Agent configured with the provided options.
type AgentOption ¶
type AgentOption interface {
// contains filtered or unexported methods
}
AgentOption provides a well-typed and sound mechanism to configure an Agent.
func WithClock ¶
func WithClock(clock clockwork.Clock) AgentOption
WithClock configures the Agent to use the provided clock.
func WithDialOpts ¶
func WithDialOpts(dialOpts ...grpc.DialOption) AgentOption
WithDialOpts configures the Agent to use the provided DialOptions when connecting to the CDPI endpoint.
NOTE: The CDPI agent always uses the `grpc.WithBlock` option to ensure initial connection errors are caught immediately, whereas logical errors are often more tightly scoped to individual RPCs.
func WithNode ¶
func WithNode(id string, opts ...NodeOption) AgentOption
WithNode configures a network node for the agent to represent.
func WithRealClock ¶
func WithRealClock() AgentOption
WithRealClock configures the Agent to use a real clock.
func WithServerEndpoint ¶
func WithServerEndpoint(endpoint string) AgentOption
WithServerEndpoint configures the Agent to connect to the provided endpoint.
type NodeOption ¶
type NodeOption interface {
// contains filtered or unexported methods
}
NodeOption provides a well-typed and sound mechanism to configure an individual node that an Agent will manage.
func WithEnactmentBackend ¶
func WithEnactmentBackend(eb enactment.Backend) NodeOption
WithEnactmentBackend configures the EnactmentBackend for the given Node.
func WithInitialState ¶
func WithInitialState(initState *afpb.ControlStateNotification) NodeOption
WithInitialState configures the initial state of the Node.
func WithTelemetryBackend ¶
func WithTelemetryBackend(tb telemetry.Backend) NodeOption
WithTelemetryBackend configures the telemetry.Backend for the given Node.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
agent
Package main provides a CDPI agent that is configured using a protobuf-based manifest.
|
Package main provides a CDPI agent that is configured using a protobuf-based manifest. |
extproc_agent
Package main provides a CDPI agent that delegates enactments to an external process.
|
Package main provides a CDPI agent that delegates enactments to an external process. |
extproc
Package extproc provides an enactment.Backend implementation that relies on an external process to enact changes.
|
Package extproc provides an enactment.Backend implementation that relies on an external process to enact changes. |
internal
|
|
channels
Package channels provide some simple adapters to facilitate common read/write patterns.
|
Package channels provide some simple adapters to facilitate common read/write patterns. |
extprocs
Package extprocs provides common utilities shared between the extproc backends.
|
Package extprocs provides common utilities shared between the extproc backends. |
loggable
Package loggable provides some adaptors for logging Spacetime domain objects using the zerolog library.
|
Package loggable provides some adaptors for logging Spacetime domain objects using the zerolog library. |
task
Package task provides some useful helpers to express common tasks like retries and adding contextual information to a context-scoped logger.
|
Package task provides some useful helpers to express common tasks like retries and adding contextual information to a context-scoped logger. |
extproc
Package extproc provides a telemetry.Backend implementation that relies on an external process to generate telemetry reports in the specified form.
|
Package extproc provides a telemetry.Backend implementation that relies on an external process to generate telemetry reports in the specified form. |