Documentation ¶
Index ¶
- Variables
- func AddClosableResource(ctx context.Context, closer io.Closer)
- type Kernel
- func (k *Kernel) APIDoc(ctx context.Context) (*spec.Swagger, error)
- func (k *Kernel) Bootstrap(ctx context.Context) error
- func (k *Kernel) Config() salusaconfig.Config
- func (k *Kernel) RootHandler() http.Handler
- func (k *Kernel) Run(ctx context.Context) error
- func (k *Kernel) RunHttpServer(ctx context.Context) error
- func (k *Kernel) RunServices(ctx context.Context)
- func (k *Kernel) Validate(ctx context.Context) error
- type KernelOption
- func APIDocumentation(options ...openapidoc.SwaggerOption) KernelOption
- func Bootstrap(bootstrap ...func(context.Context) error) KernelOption
- func Config[T salusaconfig.Config](cb func() T) KernelOption
- func InitRoutes(cb func(r *router.Router)) KernelOption
- func Middleware(globalMiddleware []router.MiddlewareFunc) KernelOption
- func RootHandler(rootHandler func(ctx context.Context) http.Handler) KernelOption
- func Services(services ...Service) KernelOption
- type Restarter
- type Service
- type ServiceFunc
- type ServiceFuncRestart
- type StdoutResponseWriter
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAlreadyBootstrapped = errors.New("kernel already bootstrapped")
)
View Source
var ErrNotInKernel = errors.New("not in kernel")
Functions ¶
Types ¶
type Kernel ¶
type Kernel struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...KernelOption) *Kernel
func (*Kernel) Config ¶ added in v0.11.0
func (k *Kernel) Config() salusaconfig.Config
func (*Kernel) RootHandler ¶ added in v0.11.0
func (*Kernel) RunHttpServer ¶ added in v0.5.0
func (*Kernel) RunServices ¶ added in v0.5.0
type KernelOption ¶
func APIDocumentation ¶ added in v0.13.1
func APIDocumentation(options ...openapidoc.SwaggerOption) KernelOption
func Config ¶ added in v0.5.0
func Config[T salusaconfig.Config](cb func() T) KernelOption
func InitRoutes ¶
func InitRoutes(cb func(r *router.Router)) KernelOption
func Middleware ¶
func Middleware(globalMiddleware []router.MiddlewareFunc) 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
type StdoutResponseWriter ¶ added in v0.13.1
type StdoutResponseWriter struct {
// contains filtered or unexported fields
}
func NewStdoutResponseWriter ¶ added in v0.13.1
func NewStdoutResponseWriter() *StdoutResponseWriter
func (*StdoutResponseWriter) Header ¶ added in v0.13.1
func (s *StdoutResponseWriter) Header() http.Header
Header implements http.ResponseWriter.
func (*StdoutResponseWriter) Ok ¶ added in v0.13.1
func (w *StdoutResponseWriter) Ok() bool
func (*StdoutResponseWriter) Status ¶ added in v0.13.1
func (w *StdoutResponseWriter) Status() int
func (*StdoutResponseWriter) Write ¶ added in v0.13.1
func (s *StdoutResponseWriter) Write(b []byte) (int, error)
Write implements http.ResponseWriter.
func (*StdoutResponseWriter) WriteHeader ¶ added in v0.13.1
func (s *StdoutResponseWriter) WriteHeader(statusCode int)
WriteHeader implements http.ResponseWriter.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.