app

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

func New

func New(opts ...Option) (*Application, error)

func NewFromConfig

func NewFromConfig(appConfig Config) (*Application, error)

func (*Application) AddClosers

func (a *Application) AddClosers(closers ...Closer)

func (*Application) AddRunners

func (a *Application) AddRunners(runners ...Runner)

func (*Application) Close

func (a *Application) Close()

func (*Application) Config

func (a *Application) Config() *config.Config

func (*Application) Context

func (a *Application) Context() context.Context

func (*Application) Logger

func (a *Application) Logger() *log.Adapter

func (*Application) Run

func (a *Application) Run() error

func (*Application) Shutdown

func (a *Application) Shutdown()

type Closer

type Closer interface {
	Close() error
}

type CloserFunc

type CloserFunc func() error

func (CloserFunc) Close

func (c CloserFunc) Close() error

type Config

type Config struct {
	LoggerConfigSupplier LoggerConfigSupplier
	ConfigOptions        []config.Option
}

func DefaultConfig

func DefaultConfig() *Config

type LoggerConfigSupplier

type LoggerConfigSupplier func(cfg *config.Config) log.Config

type Option

type Option func(c *Config)

func WithConfigOptions

func WithConfigOptions(opts ...config.Option) Option

func WithLoggerConfigSupplier

func WithLoggerConfigSupplier(supplier LoggerConfigSupplier) Option

type Runner

type Runner interface {
	Run(ctx context.Context) error
}

type RunnerFunc

type RunnerFunc func(ctx context.Context) error

func (RunnerFunc) Run

func (r RunnerFunc) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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