application

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 20 Imported by: 0

README

application

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the version of the application. It can be set from using LDFLAGS.
	Version = ""
	// Build is the commit hash originated the build version. It can be set from using LDFLAGS.
	Build = ""
	// BuildDate is the timestamp informing when the app was built. It can be set from using LDFLAGS.
	BuildDate = ""
)
View Source
var (
	ErrAppNotRunningYet = errors.New("app is not running yet")
)

Functions

This section is empty.

Types

type Application

type Application struct {
	ConfigManager *config.Manager
	Runner        *goservices.Runner
	// contains filtered or unexported fields
}

func New

func New() *Application

func (*Application) Run

func (app *Application) Run(setup ServiceSetup)

func (*Application) Shutdown

func (app *Application) Shutdown(handler func()) *Application

func (*Application) WithContext

func (app *Application) WithContext(ctx context.Context) *Application

func (*Application) WithDisableSystemServer added in v0.2.0

func (app *Application) WithDisableSystemServer(disable bool) *Application

func (*Application) WithEnvironment

func (app *Application) WithEnvironment(environment string) *Application

func (*Application) WithLoggerZapOptions added in v0.2.0

func (app *Application) WithLoggerZapOptions(options ...zap.Option) *Application

func (*Application) WithName added in v0.3.0

func (app *Application) WithName(value string) *Application

func (*Application) WithSkipConfig added in v0.6.0

func (app *Application) WithSkipConfig(skip bool) *Application

WithSkipConfig skips the configuration loading when this instance runs.

func (*Application) WithVersion

func (app *Application) WithVersion(version, build, buildDate string) *Application

WithVersion customizes the version of the application. Deprecated: Now the versions are extracted automatically from the go1.18 buildinfo.

func (*Application) WithZapConfigModifier added in v0.7.0

func (app *Application) WithZapConfigModifier(f func(*zap.Config)) *Application

type HealthChecker added in v0.2.0

type HealthChecker interface {
	IsHealthy(ctx context.Context) error
}

type ReadyChecker added in v0.2.0

type ReadyChecker interface {
	IsReady(ctx context.Context) error
}

type ServiceSetup

type ServiceSetup func(ctx context.Context, app *Application) ([]goservices.Service, error)

ServiceSetup is the handler that is pased to the Application.Run receiver.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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