kernel

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 21 Imported by: 9

Documentation

Index

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

func AddClosableResource added in v0.14.0

func AddClosableResource(ctx context.Context, closer io.Closer)

Types

type Kernel

type Kernel struct {
	// contains filtered or unexported fields
}

func New

func New(options ...KernelOption) *Kernel

func (*Kernel) APIDoc added in v0.13.1

func (k *Kernel) APIDoc(ctx context.Context) (*spec.Swagger, error)

Operation implements openapidoc.Operationer.

func (*Kernel) Bootstrap

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

func (*Kernel) Config added in v0.11.0

func (k *Kernel) Config() salusaconfig.Config

func (*Kernel) RootHandler added in v0.11.0

func (k *Kernel) RootHandler() http.Handler

func (*Kernel) Run

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

func (*Kernel) RunHttpServer added in v0.5.0

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

func (*Kernel) RunServices added in v0.5.0

func (k *Kernel) RunServices(ctx context.Context)

func (*Kernel) Validate added in v0.11.0

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

type KernelOption

type KernelOption func(*Kernel) *Kernel

func APIDocumentation added in v0.13.1

func APIDocumentation(options ...openapidoc.SwaggerOption) KernelOption

func Bootstrap

func Bootstrap(bootstrap ...func(context.Context) error) 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 Restarter added in v0.5.0

type Restarter interface {
	Restart()
}

type Service added in v0.3.0

type Service interface {
	Run(ctx context.Context) error
	Name() string
}

type ServiceFunc added in v0.3.0

type ServiceFunc func() 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) error

type ServiceFuncRestart added in v0.3.0

type ServiceFuncRestart func() error

func (ServiceFuncRestart) Run added in v0.3.0

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.

type Validator added in v0.11.0

type Validator interface {
	Validate(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL