anware

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterModule

func RegisterModule[F any, C any](
	name string,
	constructor func(local aninterface.StaticData, config C, flags F, logger aninterface.AnLogger) AnModule,
)

Types

type AnModule

type AnModule interface {
	Name() string
	Param(ctx context.Context, in <-chan AnWareEvent, mw *AnWare)
	Start()
	Stop() error
}

type AnWare

type AnWare struct {
	Logger aninterface.AnLogger
	// contains filtered or unexported fields
}

func NewAnWare

func NewAnWare(context context.Context, cancel context.CancelFunc, logger aninterface.AnLogger) *AnWare

func (*AnWare) AutoLoadModules

func (m *AnWare) AutoLoadModules(staticData aninterface.StaticData, configData any, flags any, logger aninterface.AnLogger)

func (*AnWare) Broadcast

func (m *AnWare) Broadcast(msg AnWareEvent)

func (*AnWare) LoopOfAnWare

func (m *AnWare) LoopOfAnWare(msg AnWareEvent)

func (*AnWare) Run

func (m *AnWare) Run()

func (*AnWare) Send

func (m *AnWare) Send(msg AnWareEvent)

func (*AnWare) Shutdown

func (m *AnWare) Shutdown()

type AnWareEvent

type AnWareEvent struct {
	Source string
	Target string
	Type   string
	Data   any
}

type GenericModuleConstructor

type GenericModuleConstructor[F any, C any] struct {
	// contains filtered or unexported fields
}

func (GenericModuleConstructor[F, C]) Build

func (g GenericModuleConstructor[F, C]) Build(local aninterface.StaticData, config any, flags any, logger aninterface.AnLogger) AnModule

type ModuleFactory

type ModuleFactory interface {
	Build(local aninterface.StaticData, config any, flags any, logger aninterface.AnLogger) AnModule
}

Jump to

Keyboard shortcuts

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