Documentation ¶
Index ¶
- type Conf
- type ConsulRegistry
- type DefaultServerInstance
- func (serviceInstance *DefaultServerInstance) GetHost() string
- func (serviceInstance *DefaultServerInstance) GetKey() string
- func (serviceInstance *DefaultServerInstance) GetMetadata() map[string]string
- func (serviceInstance *DefaultServerInstance) GetPort() int
- func (serviceInstance *DefaultServerInstance) IsSecure() bool
- type Predicates
- type Routes
- type ServerInstance
- type ServerRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulRegistry ¶
type ConsulRegistry struct { ListenOn string FetchInterval int64 Routes Predicates // contains filtered or unexported fields }
func NewConsulRegistry ¶
func NewConsulRegistry(conf *Conf) *ConsulRegistry
func (*ConsulRegistry) Deregister ¶
func (c *ConsulRegistry) Deregister()
func (*ConsulRegistry) FetchInstances ¶
func (c *ConsulRegistry) FetchInstances()
func (*ConsulRegistry) Register ¶
func (c *ConsulRegistry) Register(serverInstance ServerInstance, listenOn string)
func (*ConsulRegistry) SetPredicates ¶
func (c *ConsulRegistry) SetPredicates(rs []routes.Route, strategy int)
type DefaultServerInstance ¶
type DefaultServerInstance struct { Host string Port int Name string Secure bool Metadata map[string]string }
func (*DefaultServerInstance) GetHost ¶
func (serviceInstance *DefaultServerInstance) GetHost() string
func (*DefaultServerInstance) GetKey ¶
func (serviceInstance *DefaultServerInstance) GetKey() string
func (*DefaultServerInstance) GetMetadata ¶
func (serviceInstance *DefaultServerInstance) GetMetadata() map[string]string
func (*DefaultServerInstance) GetPort ¶
func (serviceInstance *DefaultServerInstance) GetPort() int
func (*DefaultServerInstance) IsSecure ¶
func (serviceInstance *DefaultServerInstance) IsSecure() bool
type Predicates ¶
type Predicates map[string]server.LoadBalance // url pattern prefix 匹配
type Routes ¶
type Routes map[string]server.LoadBalance // 对应的负载均衡类
type ServerInstance ¶
type ServerRegistry ¶
type ServerRegistry interface { Register(ServerInstance, string) Deregister() SetPredicates([]routes.Route, int) FetchInstances() }
Click to show internal directories.
Click to hide internal directories.