app

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: MIT Imports: 6 Imported by: 4

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 added in v1.4.0

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 added in v1.4.0

func (a *Application) Close()

func (*Application) Config added in v1.4.0

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

func (*Application) Context

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

func (*Application) Logger added in v1.4.0

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

func (*Application) Run

func (a *Application) Run() error

func (*Application) Shutdown

func (a *Application) Shutdown()

type Closer added in v1.4.0

type Closer interface {
	Close(ctx context.Context) error
}

type CloserFunc

type CloserFunc func(ctx context.Context) error

func (CloserFunc) Close added in v1.4.0

func (c CloserFunc) Close(ctx context.Context) error

type Config added in v1.4.0

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

func DefaultConfig added in v1.4.0

func DefaultConfig() *Config

type EncoderType added in v1.6.3

type EncoderType string
const (
	JsonEncoderType      EncoderType = "json"
	PlainTextEncoderType EncoderType = "plain-text"
)

type LogConfig added in v1.6.3

type LogConfig struct {
	FileOutput        *file.Config
	EncoderType       EncoderType
	DeduplicateFields bool
}

type LoggerConfigSupplier added in v1.4.0

type LoggerConfigSupplier func(cfg *config.Config) LogConfig

type Option added in v1.4.0

type Option func(c *Config)

func WithConfigOptions added in v1.4.0

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

type Runner added in v1.4.0

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

type RunnerFunc

type RunnerFunc func(context.Context) error

func (RunnerFunc) Run added in v1.4.0

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