reboot

package
v0.0.0-...-c3d9892 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs a reboot worker, using the resource names defined in the supplied config.

func NewReboot

func NewReboot(client reboot.Client, agentTag names.Tag, machineLock machinelock.Lock) (worker.Worker, error)

Types

type ManifoldConfig

type ManifoldConfig struct {
	AgentName     string
	APICallerName string
	MachineLock   machinelock.Lock
}

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

type Reboot

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

The reboot worker listens for changes to the reboot flag and exists with worker.ErrRebootMachine if the machine should reboot or with worker.ErrShutdownMachine if it should shutdown. This will be picked up by the machine agent as a fatal error and will do the right thing (reboot or shutdown)

func (*Reboot) Handle

func (r *Reboot) Handle(ctx context.Context) error

func (*Reboot) SetUp

func (r *Reboot) SetUp(ctx context.Context) (watcher.NotifyWatcher, error)

func (*Reboot) TearDown

func (r *Reboot) TearDown() error

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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