registry

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module interface {
	// Name returns the module's name
	Name() string

	// RegisterCommands registers the module's commands with the root command
	RegisterCommands(rootCmd *cobra.Command)
}

Module is the interface that all command modules must implement

type Registry

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

Registry keeps track of all registered modules

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new module registry

func (*Registry) Register

func (r *Registry) Register(module Module)

Register adds a module to the registry

func (*Registry) RegisterAll

func (r *Registry) RegisterAll(rootCmd *cobra.Command)

RegisterAll registers all modules with the root command

Jump to

Keyboard shortcuts

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