entry

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterStart added in v0.1.2

func AfterStart(fn func())

func AfterStop added in v0.1.2

func AfterStop(fn func())

func BeforeStart added in v0.1.2

func BeforeStart(fn func())

func BeforeStop added in v0.1.2

func BeforeStop(fn func())

func GetAfterStartsList added in v0.1.2

func GetAfterStartsList() []func()

func GetAfterStopsList added in v0.1.2

func GetAfterStopsList() []func()

func GetBeforeStartsList added in v0.1.2

func GetBeforeStartsList() []func()

func GetBeforeStopsList added in v0.1.2

func GetBeforeStopsList() []func()

func Watch added in v0.1.2

func Watch(cb func(ent Entry)) error

Types

type Entry added in v0.0.21

type Entry interface {
	AfterStop(func())
	BeforeStop(func())
	AfterStart(func())
	BeforeStart(func())
	OnCfg(fn interface{})
	Middleware(middleware Middleware)
	Description(description ...string)
	Flags(fn func(flags *pflag.FlagSet))
	Commands(commands ...*cobra.Command)
}

type Middleware added in v0.1.2

type Middleware func(next Wrapper) Wrapper

type Opt

type Opt func(o *Opts)

type Opts

type Opts struct {
	Name         string
	BeforeStarts []func()
	AfterStarts  []func()
	BeforeStops  []func()
	AfterStops   []func()
	Command      *cobra.Command
	Middlewares  []Middleware
}

type Runtime

type Runtime interface {
	InitRT() error
	Start() error
	Stop() error
	Options() Opts
}

type Wrapper added in v0.1.2

type Wrapper func(ctx context.Context, req types.Request, resp func(rsp types.Response) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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