anware

package
v1.2.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterModule

func RegisterModule(desc ModuleDescriptor)

Types

type AnModule

type AnModule interface {
	Name() string

	SetRuntime(
		name string,
		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,
	appConfig 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 BaseModule added in v1.2.1

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

func (*BaseModule) Ctx added in v1.2.1

func (b *BaseModule) Ctx() context.Context

func (*BaseModule) In added in v1.2.1

func (b *BaseModule) In() <-chan AnWareEvent

func (*BaseModule) MW added in v1.2.1

func (b *BaseModule) MW() *AnWare

func (*BaseModule) Name added in v1.2.1

func (b *BaseModule) Name() string

func (*BaseModule) SetRuntime added in v1.2.1

func (b *BaseModule) SetRuntime(
	name string,
	ctx context.Context,
	in <-chan AnWareEvent,
	mw *AnWare,
)

type ConfigValidator added in v1.1.0

type ConfigValidator interface {
	Validate() 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 ModuleDescriptor added in v1.1.0

type ModuleDescriptor struct {
	Name string

	New func(
		local aninterface.StaticData,
		cfg any,
		logger aninterface.AnLogger,
	) AnModule

	ConfigType any
}

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