Documentation ¶
Overview ¶
Package web provides web based micro services
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 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 MicroService(s micro.Service) 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 Secure(b bool) Option
- func Server(srv *http.Server) Option
- func TLSConfig(t *tls.Config) 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 ¶ added in v0.2.0
Context specifies a context for the service. Can be used to signal shutdown of the service. Can be used for extra option values.
func MicroService ¶ added in v0.5.0
func MicroService(s micro.Service) Option
MicroService sets the micro.Service used internally
func RegisterInterval ¶
func RegisterTTL ¶
func Secure ¶ added in v0.5.0
Secure Use secure communication. If TLSConfig is not specified we use InsecureSkipVerify and generate a self signed cert
type Options ¶
type Options struct { Name string Version string Id string Metadata map[string]string Address string Advertise string Action func(*cli.Context) Flags []cli.Flag RegisterTTL time.Duration RegisterInterval time.Duration Server *http.Server Handler http.Handler // Alternative Options Context context.Context Registry registry.Registry Service micro.Service Secure bool TLSConfig *tls.Config BeforeStart []func() error BeforeStop []func() error AfterStart []func() error AfterStop []func() error }
Click to show internal directories.
Click to hide internal directories.