device

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BootstrapComplete = "Bootstrap complete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent is responsible for managing the applications, configuration and status of the device.

func NewAgent

func NewAgent(
	name string,
	deviceWriter fileio.Writer,
	statusManager status.Manager,
	specManager spec.Manager,
	appManager applications.Manager,
	systemdManager systemd.Manager,
	fetchSpecInterval util.Duration,
	statusUpdateInterval util.Duration,
	hookManager hook.Manager,
	osManager os.Manager,
	policyManager policy.Manager,
	lifecycleManager lifecycle.Manager,
	applicationsController *applications.Controller,
	configController *config.Controller,
	resourceController *resource.Controller,
	consoleController *console.ConsoleController,
	osClient os.Client,
	podmanClient *client.Podman,
	backoff wait.Backoff,
	log *log.PrefixLogger,
) *Agent

NewAgent creates a new device agent.

func (*Agent) ReloadConfig added in v0.7.0

func (a *Agent) ReloadConfig(ctx context.Context, config *agent_config.Config) error

ReloadConfig reloads the device agent configuration. This is called when the device agent is reloaded.

func (*Agent) Run

func (a *Agent) Run(ctx context.Context) error

Run starts the device agent reconciliation loop.

func (*Agent) Stop added in v0.3.0

func (a *Agent) Stop(ctx context.Context) error

Stop ensures that the device agent stops reconciling during graceful shutdown.

type Bootstrap

type Bootstrap struct {
	// contains filtered or unexported fields
}

func NewBootstrap

func NewBootstrap(
	deviceName string,
	executer executer.Executer,
	deviceReadWriter fileio.ReadWriter,
	specManager spec.Manager,
	statusManager status.Manager,
	hookManager hook.Manager,
	lifecycleInitializer lifecycle.Initializer,
	managementServiceConfig *baseclient.Config,
	systemInfoManager systeminfo.Manager,
	log *log.PrefixLogger,
) *Bootstrap

func (*Bootstrap) Initialize

func (b *Bootstrap) Initialize(ctx context.Context) error

type Clock added in v0.4.0

type Clock interface {
	Now() time.Time
	NewTicker(d time.Duration) Ticker
}

Clock interface allows us to mock time in tests.

type Engine added in v0.4.0

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine added in v0.4.0

func NewEngine(
	fetchSpecInterval util.Duration,
	fetchSpecFn func(context.Context),
	pushStatusInterval util.Duration,
	pushStatusFn func(context.Context),
) *Engine

NewEngine creates a new device engine.

func (*Engine) Run added in v0.4.0

func (e *Engine) Run(ctx context.Context) error

type Ticker added in v0.4.0

type Ticker interface {
	C() <-chan time.Time
	Stop()
}

Tick is an interface that resembles time.Ticker.

Directories

Path Synopsis
Package applications is a generated GoMock package.
Package applications is a generated GoMock package.
Package console is a generated GoMock package.
Package console is a generated GoMock package.
Package fileio is a generated GoMock package.
Package fileio is a generated GoMock package.
Package hook is a generated GoMock package.
Package hook is a generated GoMock package.
Package lifecycle is a generated GoMock package.
Package lifecycle is a generated GoMock package.
Package os is a generated GoMock package.
Package os is a generated GoMock package.
Package policy is a generated GoMock package.
Package policy is a generated GoMock package.
Package resource is a generated GoMock package.
Package resource is a generated GoMock package.
Package spec is a generated GoMock package.
Package spec is a generated GoMock package.
Package status is a generated GoMock package.
Package status is a generated GoMock package.
Package systemd is a generated GoMock package.
Package systemd is a generated GoMock package.
Package systeminfo is a generated GoMock package.
Package systeminfo is a generated GoMock package.

Jump to

Keyboard shortcuts

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