application

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 14 Imported by: 0

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(inits ...Option) *Application

func (*Application) Campus

func (app *Application) Campus() string

func (*Application) Endpoints

func (app *Application) Endpoints() []types.ServerInfo

func (*Application) Init

func (app *Application) Init(opts ...Option)

func (*Application) Metadata

func (app *Application) Metadata() map[string]string

func (*Application) Name

func (app *Application) Name() string

func (*Application) Namespace

func (app *Application) Namespace() string

func (*Application) Region

func (app *Application) Region() string

func (*Application) Run

func (app *Application) Run() error

func (*Application) Stop

func (app *Application) Stop() error

func (*Application) Version

func (app *Application) Version() string

func (*Application) Zone

func (app *Application) Zone() string

type Option

type Option func(*Application) error

func WithAfterStopHook

func WithAfterStopHook(fns ...func() error) Option

func WithBeforeStopHook

func WithBeforeStopHook(fns ...func() error) Option

func WithHook

func WithHook(stage Stage, fns ...func() error) Option

func WithRegistry

func WithRegistry(registry types.Registry) Option

func WithServers

func WithServers(servers ...types.Server) Option

func WithShutdownTimeout

func WithShutdownTimeout(timeout time.Duration) Option

type Stage

type Stage uint32
const (
	StageMin Stage = iota
	// StageBeforeStop before app stop
	StageBeforeStop
	// StageAfterStop after app stop
	StageAfterStop

	StageMax
)

Jump to

Keyboard shortcuts

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