anware

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 5 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) SendSync added in v1.0.4

func (m *AnWare) SendSync(
	source string,
	target string,
	msgType string,
	data any,
) (any, error)

func (*AnWare) Shutdown

func (m *AnWare) Shutdown()

type AnWareEvent

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

	ReplyTo chan AnWareReply
}

type AnWareReply added in v1.0.4

type AnWareReply struct {
	Data any
	Err  error
}

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