manager

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directive added in v0.0.4

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

Directive is a wrapper struct that encapsulates an inventory.Directive

func (Directive) String added in v0.0.4

func (dir Directive) String() string

type Manager

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

Manager contains fields related to track and execute runnable modules and statistics.

func NewManager

func NewManager(id string) *Manager

NewManager returns a new Manager struct instantiated with the given ID

func (*Manager) Reload

func (mgr *Manager) Reload(ctx context.Context, logger *slog.Logger, inv inventory.Store)

Reload accepts a struct that fulfills the inventory.Store interface and reloads the hosts modules/directives from the inventory

func (*Manager) ReloadAndRunAll added in v0.2.0

func (mgr *Manager) ReloadAndRunAll(ctx context.Context, logger *slog.Logger, inv inventory.Store)

ReloadAndRunAll is a wrapper function to reload from the specified inventory, populate some run specific context, and initiate a run of all managed modules

func (*Manager) ReloadDirectives added in v0.0.4

func (mgr *Manager) ReloadDirectives(ctx context.Context)

ReloadDirectives reloads the manager's directives from the specified inventory.

func (*Manager) ReloadModules added in v0.0.4

func (mgr *Manager) ReloadModules(ctx context.Context, logger *slog.Logger)

ReloadModules reloads the manager's modules from the specified inventory.

func (*Manager) ReloadVariables added in v0.5.0

func (mgr *Manager) ReloadVariables(ctx context.Context, logger *slog.Logger, paths []string, hostVars VariableMap) VariableSlice

func (*Manager) RunAll

func (mgr *Manager) RunAll(ctx context.Context, logger *slog.Logger)

RunAll runs all of the Directives being managed by the Manager, followed by all of the Modules being managed by the Manager.

func (*Manager) RunDirective added in v0.0.4

func (mgr *Manager) RunDirective(ctx context.Context, ds Directive) error

RunDirective is responsible for actually executing a directive, using the `shell` package.

func (*Manager) RunDirectives

func (mgr *Manager) RunDirectives(ctx context.Context, logger *slog.Logger)

RunDirectives runs all of the directive scripts being managed by the Manager

func (*Manager) RunModule added in v0.0.4

func (mgr *Manager) RunModule(ctx context.Context, logger *slog.Logger, mod Module) error

RunModule is responsible for actually executing a module, using the `shell` package.

func (*Manager) RunModules

func (mgr *Manager) RunModules(ctx context.Context, logger *slog.Logger)

RunModules runs all of the modules being managed by the Manager

func (*Manager) String

func (mgr *Manager) String() string

type Module added in v0.0.4

type Module struct {
	Variables VariableSlice
	// contains filtered or unexported fields
}

Module is a wrapper struct that encapsulates an inventory.Module, and exports a `Variables`, which a `VariableSlce`, where each item is a variable for the module in `key=value` form (the same as returned by `os.Environ()`)

func (Module) String added in v0.0.4

func (mod Module) String() string

type VariableMap added in v0.2.0

type VariableMap = shell.VariableMap

type VariableSlice added in v0.2.0

type VariableSlice = shell.VariableSlice

Jump to

Keyboard shortcuts

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