setup

package
v0.30.113 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 11 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootstrap added in v0.30.90

type Bootstrap interface {
	Startup(
		ctx context.Context,
		h miruken.Handler,
	) *promise.Promise[struct{}]

	Shutdown(
		ctx context.Context,
	) *promise.Promise[struct{}]
}

Bootstrap is used to customize application startup and shutdown. All Bootstrap instances are resolved during New setup and Startup invoked concurrently. Shutdown is invoked in reverse order.

type Builder

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

Builder orchestrates the setup process.

func New

func New(features ...Feature) *Builder

New returns a new Builder with initial Feature's.

func (*Builder) Builders

func (s *Builder) Builders(
	builders ...miruken.Builder,
) *Builder

func (*Builder) Context

func (s *Builder) Context() (*context.Context, error)

func (*Builder) ContextAsync added in v0.30.91

func (s *Builder) ContextAsync() *promise.Promise[*context.Context]

func (*Builder) ExcludeSpecs

func (s *Builder) ExcludeSpecs(
	excludes ...miruken.Predicate[miruken.HandlerSpec],
) *Builder

func (*Builder) Factory

func (*Builder) Features

func (s *Builder) Features(
	features ...Feature,
) *Builder

func (*Builder) Filters

func (s *Builder) Filters(
	providers ...miruken.FilterProvider,
) *Builder

func (*Builder) Handlers

func (s *Builder) Handlers(
	handlers ...any,
) *Builder

func (*Builder) Observers

func (s *Builder) Observers(
	observers ...miruken.HandlerInfoObserver,
) *Builder

func (*Builder) Options

func (s *Builder) Options(
	options ...any,
) *Builder

func (*Builder) Parsers

func (s *Builder) Parsers(
	parsers ...miruken.BindingParser,
) *Builder

func (*Builder) Specs

func (s *Builder) Specs(
	specs ...any,
) *Builder

func (*Builder) Tag

func (s *Builder) Tag(tag any) bool

func (*Builder) With

func (s *Builder) With(
	values ...any,
) *Builder

func (*Builder) WithoutInference

func (s *Builder) WithoutInference() *Builder

type Feature

type Feature interface {
	Install(*Builder) error
}

Feature encapsulates custom setup.

func FeatureSet

func FeatureSet(features ...Feature) Feature

FeatureSet combines one or more Feature's into a single logical Feature.

type FeatureFunc

type FeatureFunc func(*Builder) error

func (FeatureFunc) Install

func (f FeatureFunc) Install(b *Builder) error

type Options added in v0.30.91

type Options struct {
	StartupTimeout  time.Duration
	ShutdownTimeout time.Duration
}

Options is used to customize the setup process.

Jump to

Keyboard shortcuts

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