Documentation ¶
Index ¶
- Variables
- type Kernel
- type KernelConfig
- type KernelOption
- func Bootstrap(bootstrap ...func(context.Context) error) KernelOption
- func Config[T KernelConfig](cb func() T) KernelOption
- func InitRoutes(cb func(r *router.Router)) KernelOption
- func RootHandler(rootHandler func(ctx context.Context) http.Handler) KernelOption
- func Services(services ...Service) KernelOption
- type Restarter
- type Service
- type ServiceFunc
- type ServiceFuncRestart
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAlreadyBootstrapped = errors.New("kernel already bootstrapped")
)
Functions ¶
This section is empty.
Types ¶
type Kernel ¶
type Kernel struct {
// contains filtered or unexported fields
}
func New ¶
func New[T KernelConfig](options ...KernelOption) *Kernel
func (*Kernel) RunHttpServer ¶ added in v0.5.0
func (*Kernel) RunServices ¶ added in v0.5.0
type KernelConfig ¶ added in v0.5.0
type KernelConfig interface {
GetHTTPPort() int
}
type KernelOption ¶
func Config ¶ added in v0.5.0
func Config[T KernelConfig](cb func() T) KernelOption
func InitRoutes ¶
func InitRoutes(cb func(r *router.Router)) KernelOption
func RootHandler ¶
func RootHandler(rootHandler func(ctx context.Context) http.Handler) KernelOption
func Services ¶ added in v0.3.0
func Services(services ...Service) KernelOption
type ServiceFunc ¶ added in v0.3.0
type ServiceFunc func() error
func (ServiceFunc) Restart ¶ added in v0.3.0
func (s ServiceFunc) Restart() bool
type ServiceFuncRestart ¶ added in v0.3.0
type ServiceFuncRestart func() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.