driver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPanic is an error thrown when a panic is received.
	ErrPanic = xerrors.New("global panic", "E0100")
	// ErrUnknownPanic is an error thrown when a panic of an unknown type is received.
	ErrUnknownPanic = ErrPanic.WithMessage("unknown panic", "E0101")
)

Functions

func ErrorRecoveryOnStop

func ErrorRecoveryOnStop(recover any, prevErr error) (newErr error)

ErrorRecoveryOnStop returns an error after panic recovery.

Types

type Driver

type Driver interface {
	// RunApplication launches the application.
	RunApplication(ctx context.Context, app componego.Application, appMode componego.ApplicationMode) (int, error)
	// CreateEnvironment creates a new environment for the application.
	CreateEnvironment(ctx context.Context, app componego.Application, appMode componego.ApplicationMode) (componego.Environment, canceller, error)
}

Driver is an interface that describes the driver for starting and controlling the application.

func New

func New(options *Options) Driver

New is an application driver constructor.

type Options

type Options struct {
	ConfigProviderFactory    func() (componego.ConfigProvider, initializer)
	ComponentProviderFactory func() (componego.ComponentProvider, initializer)
	DependencyInvokerFactory func() (componego.DependencyInvoker, initializer)
	EnvironmentFactory       func(
		context context.Context,
		application componego.Application,
		applicationIO componego.ApplicationIO,
		applicationMode componego.ApplicationMode,
		configProvider componego.ConfigProvider,
		componentProvider componego.ComponentProvider,
		dependencyInvoker componego.DependencyInvoker,
	) componego.Environment
	AppIO      componego.ApplicationIO
	Additional any
}

func Configure

func Configure(options *Options) *Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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