agentcli

package
v8.56.1709838579-SHA-e... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package agentcli provides a CDPI agent that is configured using a protobuf-based manifest.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownConfigProto = errors.New("unknown config proto")

ErrUnknownConfigProto is the error a Provider should return if the provided `anypb.Any` is of an unknown type.

Functions

This section is empty.

Types

type AgentConf

type AgentConf struct {
	AppName   string
	Handles   Handles
	Providers []Provider
}

func (AgentConf) Run

func (ac AgentConf) Run(ctx context.Context, appName string, args []string) (err error)

type Handles

type Handles interface {
	Clock() clockwork.Clock
	Stdout() io.Writer
	Stderr() io.Writer
}

Handles are abstractions over impure, external resources like time and stdio streams.

func DefaultHandles

func DefaultHandles() Handles

DefaultHandles returns a Handles implementation that delegates to the standard implementations for external resources.

type Provider

type Provider interface {
	EnactmentBackend(_ context.Context, _ Handles, nodeID string, conf *anypb.Any) (enactment.Backend, error)
	TelemetryBackend(_ context.Context, _ Handles, nodeID string, conf *anypb.Any) (telemetry.Backend, error)
}

Provider provides a dynamic way of registering enactment or telemetry backend providers. If the provided configuration isn't of the appropriate type, the factory function is expected to return nil, ErrUnknownConfigProto.

type UnsupportedEnactmentBackend

type UnsupportedEnactmentBackend struct{}

func (*UnsupportedEnactmentBackend) EnactmentBackend

type UnsupportedTelemetryBackend

type UnsupportedTelemetryBackend struct{}

func (*UnsupportedTelemetryBackend) TelemetryBackend

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL