Documentation
¶
Index ¶
- Variables
- type Kernel
- func (k *Kernel) Bootstrap(ctx context.Context) error
- func (k *Kernel) DependencyProvider() *di.DependencyProvider
- func (k *Kernel) Fill(ctx context.Context, v any) error
- func (k *Kernel) Logger(ctx context.Context) *slog.Logger
- func (k *Kernel) Register(cb func(dp *di.DependencyProvider))
- func (k *Kernel) Run(ctx context.Context) error
- func (k *Kernel) RunHttpServer(ctx context.Context) error
- func (k *Kernel) RunServices(ctx context.Context)
- type KernelConfig
- type KernelOption
- func Bootstrap(bootstrap ...func(context.Context, *Kernel) error) KernelOption
- func Config[T KernelConfig](cb func() T) KernelOption
- func InitRoutes(cb func(r *router.Router)) KernelOption
- func Providers(providers ...func(*di.DependencyProvider)) KernelOption
- func RootHandler(rootHandler func() 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) DependencyProvider ¶ added in v0.8.0
func (k *Kernel) DependencyProvider() *di.DependencyProvider
func (*Kernel) Register ¶ added in v0.8.0
func (k *Kernel) Register(cb func(dp *di.DependencyProvider))
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 Providers ¶ added in v0.8.0
func Providers(providers ...func(*di.DependencyProvider)) KernelOption
func RootHandler ¶
func RootHandler(rootHandler func() 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.