kernel

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 6 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch added in v0.3.0

func Dispatch(e event.Event)

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(e event.Event)

func (*Kernel) Run

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

type KernelOption

type KernelOption func(*Kernel) *Kernel

func Bootstrap

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

func InitRoutes

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

func Listeners added in v0.3.0

func Listeners(listeners ...*Listener) KernelOption

func Middleware

func Middleware(middleware ...router.MiddlewareFunc) KernelOption

func Port

func Port(cb func() int) KernelOption

func RootHandler

func RootHandler(rootHandler 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(event E) error) *Listener

type Service added in v0.3.0

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

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) Restart added in v0.3.0

func (s ServiceFuncRestart) Restart() bool

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