foundation

package
v2.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseProvider added in v2.11.0

type BaseProvider struct{}

BaseProvider is a provider that does nothing.

func (*BaseProvider) Bootstrap added in v2.11.0

func (*BaseProvider) Bootstrap(ctx context.Context) (context.Context, error)

func (*BaseProvider) Terminate added in v2.11.0

func (*BaseProvider) Terminate(ctx context.Context) (context.Context, error)

type BootstrapFunc added in v2.12.0

type BootstrapFunc func(context.Context) (context.Context, error)

func (BootstrapFunc) Bootstrap added in v2.12.0

func (f BootstrapFunc) Bootstrap(ctx context.Context) (context.Context, error)

func (BootstrapFunc) Terminate added in v2.12.0

func (f BootstrapFunc) Terminate(ctx context.Context) (context.Context, error)

type Chain added in v2.22.0

type Chain []Provider

Chain is a provider that calls multiple providers in sequence.

func NewChain added in v2.22.0

func NewChain(providers ...Provider) Chain

func (Chain) Bootstrap added in v2.22.0

func (c Chain) Bootstrap(ctx context.Context) (context.Context, error)

func (Chain) Terminate added in v2.22.0

func (c Chain) Terminate(ctx context.Context) (context.Context, error)

type Handler added in v2.11.0

type Handler interface {
	Handle(ctx context.Context) error
}

type HandlerFunc added in v2.11.0

type HandlerFunc func(ctx context.Context) error

func (HandlerFunc) Handle added in v2.11.0

func (f HandlerFunc) Handle(ctx context.Context) error

type Kernel added in v2.11.0

type Kernel struct {
	context.Context
	// contains filtered or unexported fields
}

func NewKernel added in v2.11.0

func NewKernel(opts ...Option) *Kernel

func (*Kernel) Register added in v2.11.0

func (k *Kernel) Register(providers ...Provider)

func (*Kernel) Run added in v2.11.0

func (k *Kernel) Run() (err error)

type Option

type Option func(*Kernel)

func WithContext added in v2.11.0

func WithContext(ctx context.Context) Option

func WithHandler added in v2.11.0

func WithHandler(handler Handler) Option

func WithProviders added in v2.18.0

func WithProviders(providers ...Provider) Option

func WithTerminateTimeout added in v2.11.0

func WithTerminateTimeout(timeout time.Duration) Option

type Provider added in v2.11.0

type Provider interface {
	Bootstrap(context.Context) (context.Context, error)
	Terminate(context.Context) (context.Context, error)
}

type TerminateFunc added in v2.12.0

type TerminateFunc func(context.Context) (context.Context, error)

func (TerminateFunc) Bootstrap added in v2.12.0

func (f TerminateFunc) Bootstrap(ctx context.Context) (context.Context, error)

func (TerminateFunc) Terminate added in v2.12.0

func (f TerminateFunc) Terminate(ctx context.Context) (context.Context, error)

Jump to

Keyboard shortcuts

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