Documentation
¶
Index ¶
- Variables
- type Factory
- type Option
- func WithBalancerName(name string) Option
- func WithHeartbeatInterval(interval string) Option
- func WithHeartbeatPort(port string) Option
- func WithHeartbeatTimeout(timeout string) Option
- func WithSelectorAddress(address string) Option
- func WithSelectorDeregisterCriticalServiceAfter(t string) Option
- func WithSelectorEnableHeartbeat(b bool) Option
- func WithSelectorName(name string) Option
- func WithSelectorScheme(scheme string) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = func() *Options { return &Options{ Selector: &selector.Options{ SelectorName: "consul", Address: "127.0.0.1:8500", EnableHeartbeat: true, Scheme: "http", HeartbeatOptions: &selector.HeartbeatOptions{ Port: "8001", Timeout: "5s", Interval: "5s", DeregisterCriticalServiceAfter: "20s", }, }, Balancer: &balance.Options{ BalancerName: balance.WeightPoll, }, } }
View Source
var New = func(opts *Options) *Factory { return &Factory{ options: opts, } }
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func (*Factory) GetBalancer ¶
GetBalancer 获取负载均衡插件.
func (*Factory) GetSelector ¶
GetSelector 获取服务发现插件.
type Option ¶
type Option func(*Options)
func WithBalancerName ¶
func WithHeartbeatInterval ¶
func WithHeartbeatPort ¶
func WithHeartbeatTimeout ¶
func WithSelectorAddress ¶
func WithSelectorName ¶
func WithSelectorScheme ¶
Click to show internal directories.
Click to hide internal directories.