Documentation ¶
Overview ¶
@Time : 2019/5/13 10:37 @Author : kenny zhu @File : options.go @Software: GoLand @Others:
@Time : 2019/5/13 10:46 @Author : kenny zhu @File : service.go @Software: GoLand @Others:
@Time : 2019/5/13 10:36 @Author : kenny zhu @File : wrapper.go @Software: GoLand @Others:
Index ¶
- Variables
- type Option
- func Address(a string) Option
- func Advertise(a string) Option
- func Context(ctx context.Context) Option
- func Description(a string) Option
- func Engine(g *gin.Engine) 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 Secure(b bool) Option
- func ServiceInfo(s *registry.Service) Option
- func TLSConfig(t TLSFile) Option
- func Version(v string) Option
- type Options
- type Runner
- type Service
- type TLSFile
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *Options)
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 Description ¶
func RegisterInterval ¶
func RegisterTTL ¶
func Secure ¶
Secure Use secure communication. If TLSConfig is not specified we use InsecureSkipVerify and generate a self signed cert
func ServiceInfo ¶
type Options ¶
type Options struct { Address string Advertise string // service Name string Version string Id string Metadata map[string]string Description string // or service struct directly.. ServiceInfo *registry.Service Registry registry.Registry RegisterTTL time.Duration RegisterInterval time.Duration // define gin.Engine Engine *gin.Engine // https config Secure bool TLSConfig TLSFile // Alternative Options Context context.Context }
type Service ¶
Service is a web service with service discovery built in
func NewService ¶
NewService returns a new web.ServiceWrapper, for future use service for extend.