module

package
v0.0.0-...-8483bd9 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandInfo

type CommandInfo struct {
	Name        string
	Description string
	Usage       string
	Options     map[string]string
}

type ModuleInfo

type ModuleInfo struct {
	Name        string
	Version     string
	Description string
	Author      string
	Commands    []CommandInfo
	Options     map[string]string
}

type ModuleInterface

type ModuleInterface interface {
	GetInfo() *ModuleInfo

	Initialize() error

	ExecuteCommand(command string, args []string) (interface{}, error)
}

type ModuleLoader

type ModuleLoader struct {
	Manager *ModuleManager
}

func NewModuleLoader

func NewModuleLoader(manager *ModuleManager) *ModuleLoader

func (*ModuleLoader) LoadModuleFromFile

func (l *ModuleLoader) LoadModuleFromFile(path string) (string, error)

type ModuleManager

type ModuleManager struct {
	Registry *ModuleRegistry
	// contains filtered or unexported fields
}

func NewModuleManager

func NewModuleManager(registry *ModuleRegistry) *ModuleManager

func (*ModuleManager) ExecuteCommand

func (m *ModuleManager) ExecuteCommand(moduleName, commandName string, args []string) (interface{}, error)

func (*ModuleManager) GetModule

func (m *ModuleManager) GetModule(name string) (ModuleInterface, error)

func (*ModuleManager) GetModuleInfo

func (m *ModuleManager) GetModuleInfo(name string) (*ModuleInfo, error)

func (*ModuleManager) ListModules

func (m *ModuleManager) ListModules() []string

func (*ModuleManager) LoadModule

func (m *ModuleManager) LoadModule(name string) (ModuleInterface, error)

type ModuleRegistry

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

func NewModuleRegistry

func NewModuleRegistry() *ModuleRegistry

func (*ModuleRegistry) GetModule

func (r *ModuleRegistry) GetModule(name string) (func() ModuleInterface, error)

func (*ModuleRegistry) ListModules

func (r *ModuleRegistry) ListModules() []string

func (*ModuleRegistry) RegisterModule

func (r *ModuleRegistry) RegisterModule(name string, factory func() ModuleInterface)

type ModuleSystem

type ModuleSystem struct {
	Registry *ModuleRegistry
	Manager  *ModuleManager
	Loader   *ModuleLoader
}

func NewModuleSystem

func NewModuleSystem() *ModuleSystem

Jump to

Keyboard shortcuts

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