modules

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

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

func (*Base) AddDependencies

func (b *Base) AddDependencies(deps ...string)

func (*Base) Dependencies

func (b *Base) Dependencies() map[string]Module

func (*Base) Dependency

func (b *Base) Dependency(name string) Module

func (*Base) Log

func (b *Base) Log(lvl zerolog.Level, message string, fields ...any)

func (*Base) Logger

func (b *Base) Logger() *zerolog.Logger

func (*Base) Name

func (b *Base) Name() string

func (*Base) SetDependency

func (b *Base) SetDependency(m Module)

func (*Base) SetLogger

func (b *Base) SetLogger(l *zerolog.Logger)

func (*Base) SetName

func (b *Base) SetName(name string)

type Module

type Module interface {
	Configure(...Option) error
	Start() error
	Shutdown() error

	SetName(string)
	Name() string

	AddDependencies(...string)
	SetDependency(Module)
	Dependency(string) Module
	Dependencies() map[string]Module

	SetLogger(*zerolog.Logger)
	Logger() *zerolog.Logger
	Log(zerolog.Level, string, ...any)
}

type Option

type Option interface {
	Apply(Module) error
}

func WithLogger

func WithLogger(log *zerolog.Logger) Option

type Runtime

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

func NewRuntime

func NewRuntime() *Runtime

func (*Runtime) Configure

func (r *Runtime) Configure() error

func (*Runtime) Module

func (r *Runtime) Module(name string) Module

func (*Runtime) OrderModules

func (r *Runtime) OrderModules() error

func (*Runtime) Register

func (r *Runtime) Register(m Module, opts ...Option)

func (*Runtime) Shutdown

func (r *Runtime) Shutdown() error

func (*Runtime) Start

func (r *Runtime) Start() error

Jump to

Keyboard shortcuts

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