kernel

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 8 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch added in v0.3.0

func Dispatch(ctx context.Context, e event.Event) error

Types

type Kernel

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

func New

func New(options ...KernelOption) *Kernel

func NewDefaultKernel added in v0.3.0

func NewDefaultKernel(options ...KernelOption) *Kernel

func (*Kernel) Bootstrap

func (k *Kernel) Bootstrap(ctx context.Context) error

func (*Kernel) Dispatch added in v0.3.0

func (k *Kernel) Dispatch(ctx context.Context, e event.Event) error

func (*Kernel) Run

func (k *Kernel) Run(ctx context.Context) error

func (*Kernel) RunHttpServer added in v0.5.0

func (k *Kernel) RunHttpServer(ctx context.Context) error

func (*Kernel) RunListeners added in v0.5.0

func (k *Kernel) RunListeners(ctx context.Context)

func (*Kernel) RunServices added in v0.5.0

func (k *Kernel) RunServices(ctx context.Context) error

type KernelConfig added in v0.5.0

type KernelConfig struct {
	Port int
}

type KernelOption

type KernelOption func(*Kernel) *Kernel

func Bootstrap

func Bootstrap(bootstrap ...func(context.Context) error) KernelOption

func Config added in v0.5.0

func Config(cb func() *KernelConfig) KernelOption

func InitRoutes

func InitRoutes(cb func(r *router.Router)) KernelOption

func Listeners added in v0.3.0

func Listeners(listeners ...*Listener) KernelOption

func RootHandler

func RootHandler(rootHandler func() http.Handler) KernelOption

func Services added in v0.3.0

func Services(services ...Service) KernelOption

type Listener added in v0.3.0

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

func NewListener added in v0.3.0

func NewListener[E event.Event](cb func(ctx context.Context, event E) error) *Listener

type Restarter added in v0.5.0

type Restarter interface {
	Restart()
}

type Service added in v0.3.0

type Service interface {
	Run(ctx context.Context, k *Kernel) error
	Name() string
}

type ServiceFunc added in v0.3.0

type ServiceFunc func(k *Kernel) error

func (ServiceFunc) Restart added in v0.3.0

func (s ServiceFunc) Restart() bool

func (ServiceFunc) Run added in v0.3.0

func (s ServiceFunc) Run(ctx context.Context, k *Kernel) error

type ServiceFuncRestart added in v0.3.0

type ServiceFuncRestart func(k *Kernel) error

func (ServiceFuncRestart) Run added in v0.3.0

Jump to

Keyboard shortcuts

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