Documentation ¶
Index ¶
- Variables
- type Option
- func Action(a func(*cli.Context)) Option
- func Address(a string) Option
- func Advertise(a string) Option
- func AfterStart(fn func() error) Option
- func AfterStop(fn func() error) Option
- func BeforeStart(fn func() error) Option
- func BeforeStop(fn func() error) Option
- func Cmd(c cmd.Cmd) Option
- func Context(ctx context.Context) Option
- func Flags(flags ...cli.Flag) Option
- func Handler(h http.Handler) Option
- func Id(id string) Option
- func Metadata(md map[string]string) Option
- func Name(n string) Option
- func RegisterInterval(t time.Duration) Option
- func RegisterTTL(t time.Duration) Option
- func Registry(r registry.Registry) Option
- func Server(srv *http.Server) Option
- func Version(v string) Option
- type Options
- type Service
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *Options)
func AfterStart ¶
AfterStart is executed after server start.
func BeforeStart ¶
BeforeStart is executed before the server starts.
func BeforeStop ¶
BeforeStop is executed before the server stops.
func Context ¶
Context specifies a context for the service. Can be used to signal shutdown of the service. Can be used for extra option values.
func RegisterInterval ¶
func RegisterTTL ¶
type Options ¶
type Options struct { Name string Version string Id string Metadata map[string]string Address string Advertise string RegisterTTL time.Duration RegisterInterval time.Duration Server *http.Server Handler http.Handler // Alternative Options Context context.Context Cmd cmd.Cmd BeforeStart []func() error BeforeStop []func() error AfterStart []func() error AfterStop []func() error }
Click to show internal directories.
Click to hide internal directories.