Documentation
¶
Index ¶
- Variables
- func Register[T salusaconfig.Config](fn func(ctx context.Context, c T)) func(ctx context.Context) error
- type Kernel
- func (k *Kernel) APIDoc(ctx context.Context) (*spec.Swagger, error)
- func (k *Kernel) Bootstrap(ctx context.Context) error
- func (k *Kernel) Close() error
- func (k *Kernel) Config() salusaconfig.Config
- func (k *Kernel) HttpServer(ctx context.Context) *http.Server
- 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) StartServices(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 FetchAuth(cb func(ctx context.Context, username string, request *http.Request) error) KernelOption
- func InitRoutes(cb func(r *router.Router)) KernelOption
- func Middleware(globalMiddleware []router.Middleware) KernelOption
- func RootHandler(rootHandler func(ctx context.Context) http.Handler) KernelOption
- func Services(services ...Service) KernelOption
- type ResponseWriter
- type Restarter
- type Service
- type ServiceFunc
- type ServiceFuncRestart
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAlreadyBootstrapped = errors.New("kernel already bootstrapped")
)
Functions ¶
Types ¶
type Kernel ¶
type Kernel struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...KernelOption) *Kernel
func (*Kernel) Config ¶
func (k *Kernel) Config() salusaconfig.Config
func (*Kernel) RootHandler ¶
func (*Kernel) StartServices ¶
type KernelOption ¶
func APIDocumentation ¶
func APIDocumentation(options ...openapidoc.SwaggerOption) KernelOption
func Config ¶
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.Middleware) KernelOption
func RootHandler ¶
func RootHandler(rootHandler func(ctx context.Context) http.Handler) KernelOption
func Services ¶
func Services(services ...Service) KernelOption
type ResponseWriter ¶
type ResponseWriter struct {
// contains filtered or unexported fields
}
func NewStdoutResponseWriter ¶
func NewStdoutResponseWriter() *ResponseWriter
func (*ResponseWriter) Header ¶
func (s *ResponseWriter) Header() http.Header
Header implements http.ResponseWriter.
func (*ResponseWriter) Ok ¶
func (w *ResponseWriter) Ok() bool
func (*ResponseWriter) Status ¶
func (w *ResponseWriter) Status() int
func (*ResponseWriter) Write ¶
func (s *ResponseWriter) Write(b []byte) (int, error)
Write implements http.ResponseWriter.
func (*ResponseWriter) WriteHeader ¶
func (s *ResponseWriter) WriteHeader(statusCode int)
WriteHeader implements http.ResponseWriter.
type ServiceFunc ¶
type ServiceFunc func() error
type ServiceFuncRestart ¶
type ServiceFuncRestart func() error
func (ServiceFuncRestart) Restart ¶
func (s ServiceFuncRestart) Restart()
Click to show internal directories.
Click to hide internal directories.