app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, s AppInfo) context.Context

NewContext returns a new Context that carries value.

Types

type App

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

func NewApp

func NewApp(opts ...Option) *App

func (*App) ID

func (a *App) ID() string

ID returns app instance id.

func (*App) Name

func (a *App) Name() string

Name returns services name.

func (*App) Run

func (a *App) Run(mode string) error

func (*App) Stop

func (a *App) Stop() error

func (*App) Version

func (a *App) Version() string

Version returns app version.

type AppInfo

type AppInfo interface {
	ID() string
	Name() string
	Version() string
}

type Option

type Option func(o *options)

func Context

func Context(ctx context.Context) Option

func ID

func ID(id string) Option

func Logger

func Logger(logger *logger.Logger) Option

func Migration

func Migration(m *data.DBMigration) Option

func Name

func Name(name string) Option

func Services

func Services(srvs ...service.Service) Option

func Signal

func Signal(sigs ...os.Signal) Option

func StopTimeout

func StopTimeout(t time.Duration) Option

func Version

func Version(version string) Option

Jump to

Keyboard shortcuts

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