Versions in this module Expand all Collapse all v1 v1.0.0 Aug 18, 2021 Changes in this version + var DefaultAddress = ":0" + var DefaultId = uuid.New().String() + var DefaultName = "go-web" + var DefaultRegisterInterval = time.Second * 30 + var DefaultRegisterTTL = time.Minute + var DefaultStaticDir = "html" + var DefaultVersion = "latest" + type Option func(o *Options) + 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 Icon(ico string) 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 StaticDir(d string) Option + func TLSConfig(t *tls.Config) Option + func Version(v string) Option + type Options struct + Action func(*cli.Context) + Address string + Advertise string + AfterStart []func() error + AfterStop []func() error + BeforeStart []func() error + BeforeStop []func() error + Context context.Context + Flags []cli.Flag + Handler http.Handler + Id string + Metadata map[string]string + Name string + RegisterInterval time.Duration + RegisterTTL time.Duration + Registry registry.Registry + Secure bool + Server *http.Server + Service micro.Service + StaticDir string + TLSConfig *tls.Config + Version string + type Service interface + Client func() *http.Client + Handle func(pattern string, handler http.Handler) + HandleFunc func(pattern string, handler func(http.ResponseWriter, *http.Request)) + Init func(opts ...Option) error + Options func() Options + Run func() error + func NewService(opts ...Option) Service