Documentation
¶
Index ¶
- type 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 Bind(fn func(*grpc.Server)) Option
- func Context(ctx context.Context) Option
- func Logger(log *glog.Logger) 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(s server.Server) Option
- func Tracing(t bool) Option
- func Version(v string) Option
- type Options
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option Option
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 ¶
RegisterInterval specifies the interval on which to re-register
func RegisterTTL ¶
RegisterTTL specifies the TTL to use when registering the service
type Options ¶
type Options struct {
Server server.Server
RegistryEnable bool
Registry registry.Registry
// Register loop interval
RegisterInterval time.Duration
// Before and After funcs
BeforeStart []func() error
BeforeStop []func() error
AfterStart []func() error
AfterStop []func() error
//Bind rpc register
Bind func(*grpc.Server)
// Other options for implementations of the interface
// can be stored in a context
Context context.Context
Logger *glog.Logger
Tracing bool
}
Options Options
Click to show internal directories.
Click to hide internal directories.