Add String method to all interfaces
This commit is contained in:
@@ -143,6 +143,10 @@ func (r *blackListSelector) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *blackListSelector) String() string {
|
||||
return "blacklist"
|
||||
}
|
||||
|
||||
func NewSelector(opts ...selector.Option) selector.Selector {
|
||||
var sopts selector.Options
|
||||
|
||||
|
||||
@@ -74,6 +74,10 @@ func (r *randomSelector) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *randomSelector) String() string {
|
||||
return "random"
|
||||
}
|
||||
|
||||
func newRandomSelector(opts ...Option) Selector {
|
||||
var sopts Options
|
||||
|
||||
|
||||
@@ -73,6 +73,10 @@ func (r *roundRobinSelector) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *roundRobinSelector) String() string {
|
||||
return "roundrobin"
|
||||
}
|
||||
|
||||
func NewSelector(opts ...selector.Option) selector.Selector {
|
||||
var sopts selector.Options
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ type Selector interface {
|
||||
Reset(service string)
|
||||
// Close renders the selector unusable
|
||||
Close() error
|
||||
// Name of the selector
|
||||
String() string
|
||||
}
|
||||
|
||||
// Next is a function that returns the next node
|
||||
|
||||
Reference in New Issue
Block a user