app

package
v1.0.0-13 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithApp

func ContextWithApp(ctx context.Context, app *App) context.Context

func OnStart

func OnStart(name string, fn HookFunc)

func WaitExitSignal

func WaitExitSignal() os.Signal

Types

type App

type App struct {
	Cfg *config.Configuration
	// contains filtered or unexported fields
}

func AppFromContext

func AppFromContext(ctx context.Context) *App

func New

func New(ctx context.Context, cfg *config.Configuration) *App

func Start

func Start(ctx context.Context, service, envName string) (context.Context, *App, error)

func StartCLI

func StartCLI(c *cli.Context) (context.Context, *App, error)

func StartConfig

func StartConfig(ctx context.Context, cfg *config.Configuration) (context.Context, *App, error)

func (*App) Config

func (app *App) Config() *config.Configuration

func (*App) Context

func (app *App) Context() context.Context

func (*App) DB

func (app *App) DB(env string, debug bool) *bun.DB

func (*App) OnAfterStop

func (app *App) OnAfterStop(name string, fn HookFunc)

func (*App) OnStop

func (app *App) OnStop(name string, fn HookFunc)

func (*App) Running

func (app *App) Running() bool

func (*App) Stop

func (app *App) Stop()

func (*App) Stopping

func (app *App) Stopping() bool

type HookFunc

type HookFunc func(ctx context.Context, app *App) error

Jump to

Keyboard shortcuts

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