modmanager

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package modmanager provides the module manager for a robot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DepsToNames

func DepsToNames(deps resource.Dependencies) []string

DepsToNames converts a dependency list to a simple string slice.

func NewManager

func NewManager(
	ctx context.Context, parentAddr string, logger logging.Logger, options modmanageroptions.Options,
) modmaninterface.ModuleManager

NewManager returns a Manager.

Types

type Manager

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

Manager is the root structure for the module system.

func (*Manager) Add

func (mgr *Manager) Add(ctx context.Context, conf config.Module) error

Add adds and starts a new resource module.

func (*Manager) AddResource

func (mgr *Manager) AddResource(ctx context.Context, conf resource.Config, deps []string) (resource.Resource, error)

AddResource tells a component module to configure a new component.

func (*Manager) CleanModuleDataDirectory added in v0.13.0

func (mgr *Manager) CleanModuleDataDirectory() error

CleanModuleDataDirectory removes unexpected folders and files from the robot's module data directory. Modules removed from the robot config (even temporarily) will get pruned here.

func (*Manager) Close

func (mgr *Manager) Close(ctx context.Context) error

Close terminates module connections and processes.

func (*Manager) Configs added in v0.2.50

func (mgr *Manager) Configs() []config.Module

Configs returns a slice of config.Module representing the currently managed modules.

func (*Manager) Handles added in v0.12.0

func (mgr *Manager) Handles() map[string]modlib.HandlerMap

Handles returns all the models for each module registered.

func (*Manager) IsModularResource

func (mgr *Manager) IsModularResource(name resource.Name) bool

IsModularResource returns true if an existing resource IS handled by a module.

func (*Manager) Provides

func (mgr *Manager) Provides(conf resource.Config) bool

Provides returns true if a component/service config WOULD be handled by a module.

func (*Manager) Reconfigure added in v0.2.34

func (mgr *Manager) Reconfigure(ctx context.Context, conf config.Module) ([]resource.Name, error)

Reconfigure reconfigures an existing resource module and returns the names of now orphaned resources.

func (*Manager) ReconfigureResource

func (mgr *Manager) ReconfigureResource(ctx context.Context, conf resource.Config, deps []string) error

ReconfigureResource updates/reconfigures a modular component with a new configuration.

func (*Manager) Remove added in v0.2.34

func (mgr *Manager) Remove(modName string) ([]resource.Name, error)

Remove removes and stops an existing resource module and returns the names of now orphaned resources.

func (*Manager) RemoveResource

func (mgr *Manager) RemoveResource(ctx context.Context, name resource.Name) error

RemoveResource requests the removal of a resource from a module.

func (*Manager) ResolveImplicitDependenciesInConfig added in v0.12.0

func (mgr *Manager) ResolveImplicitDependenciesInConfig(ctx context.Context, conf *config.Diff) error

ResolveImplicitDependenciesInConfig modifies the config diff to add implicit dependencies to changed resources and updates modular resources whose module has been changed with new implicit deps and adds them to conf.Modified.

func (*Manager) ValidateConfig added in v0.2.25

func (mgr *Manager) ValidateConfig(ctx context.Context, conf resource.Config) ([]string, error)

ValidateConfig determines whether the given config is valid and returns its implicit dependencies.

Directories

Path Synopsis
Package modmanageroptions provides Options for configuring a mod manager
Package modmanageroptions provides Options for configuring a mod manager

Jump to

Keyboard shortcuts

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