Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NamedServerDiscover ¶
type NamedServerDiscover struct {
// contains filtered or unexported fields
}
func NewNamedServerDiscover ¶
func NewNamedServerDiscover(clt *Client, opts ...ServerDiscoverOption) *NamedServerDiscover
func (*NamedServerDiscover) Close ¶
func (discover *NamedServerDiscover) Close()
Close discover close
func (*NamedServerDiscover) ElectionServerEndpoint ¶
func (discover *NamedServerDiscover) ElectionServerEndpoint(name string) string
ElectionServerEndpoint 选举服务,根据算法会返回一个最佳的服务器地址
type Server ¶
type Server struct { Addr string `json:"addr"` Name string `json:"name,omitempty"` // name of the server // contains filtered or unexported fields }
func (*Server) MarshalBinary ¶
func (*Server) UnmarshalBinary ¶
type ServerDiscoverOption ¶
type ServerDiscoverOption func(svr *Server)
func WithServerNamed ¶
func WithServerNamed(name string) ServerDiscoverOption
func WithServerPort ¶
func WithServerPort(port int) ServerDiscoverOption
Click to show internal directories.
Click to hide internal directories.