sylvain

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 10 Imported by: 0

README

Sylvain

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*clientv3.Client
}

Client 包装自 etcd 的 client 客户端,负责调用 etcd 的 client 客户端

func NewEtcdEndpoints

func NewEtcdEndpoints(endpoints []string, timeout time.Duration) *Client

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) GetAddr

func (svr *Server) GetAddr() string

func (*Server) MarshalBinary

func (svr *Server) MarshalBinary() (data []byte, err error)

func (*Server) UnmarshalBinary

func (svr *Server) UnmarshalBinary(data []byte) error

type ServerDiscoverOption

type ServerDiscoverOption func(svr *Server)

func WithServerNamed

func WithServerNamed(name string) ServerDiscoverOption

func WithServerPort

func WithServerPort(port int) ServerDiscoverOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL