app

package module
Version: v0.0.0-...-81f5a29 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(appConfig Config) *zap.SugaredLogger

func Run

func Run(appCallback func(appCtx context.Context, logger *zap.SugaredLogger))

func Start

func Start(appCallback func(appCtx Context, logger *zap.SugaredLogger))

Types

type Application

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

func WithConfig

func WithConfig(config Config) *Application

func WithTerminationSignals

func WithTerminationSignals(signals ...os.Signal) *Application

func (*Application) Run

func (app *Application) Run(appCallback func(appCtx context.Context, logger *zap.SugaredLogger))

func (*Application) Start

func (app *Application) Start(appCallback func(appCtx Context, logger *zap.SugaredLogger))

func (*Application) WithConfig

func (app *Application) WithConfig(config Config) *Application

func (*Application) WithTerminationSignals

func (app *Application) WithTerminationSignals(signals ...os.Signal) *Application

type CliContext

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

func NewCliContext

func NewCliContext(signals ...os.Signal) *CliContext

func (*CliContext) Deadline

func (c *CliContext) Deadline() (deadline time.Time, ok bool)

func (*CliContext) Done

func (c *CliContext) Done() <-chan struct{}

func (*CliContext) Err

func (c *CliContext) Err() error

func (*CliContext) IsShuttingDown

func (c *CliContext) IsShuttingDown() bool

func (*CliContext) Shutdown

func (c *CliContext) Shutdown()

func (*CliContext) StartWorker

func (c *CliContext) StartWorker(worker func())

func (*CliContext) Value

func (c *CliContext) Value(key interface{}) interface{}

func (*CliContext) WaitForWorkers

func (c *CliContext) WaitForWorkers()

type Config

type Config interface {
	Validate() error
}

type Context

type Context interface {
	context.Context

	Shutdown()
	IsShuttingDown() bool
	StartWorker(worker func())
	WaitForWorkers()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to