Documentation ¶
Index ¶
- func JoinServiceName(names ...string) string
- func LocalIP() (net.IP, error)
- type Cluster
- func (s *Cluster) Endpoints() ([]endpoint.Endpoint, error)
- func (s *Cluster) Local() Node
- func (s *Cluster) Node(id string) (Node, bool)
- func (s *Cluster) Nodes() []Node
- func (s *Cluster) ServiceEndpoints(name string) ([]endpoint.Endpoint, error)
- func (s *Cluster) Services() []Node
- func (s *Cluster) Shutdown()
- type Configuration
- type EtcdConfiguration
- type Node
- type NodeLocal
- func (n NodeLocal) Address() string
- func (n NodeLocal) ID() string
- func (n *NodeLocal) Marshal() (string, error)
- func (n NodeLocal) Protocol() Protocol
- func (n NodeLocal) Service() string
- func (n *NodeLocal) SetValue(k, v string)
- func (n NodeLocal) Sub() bool
- func (n *NodeLocal) Unmarshal(data string) error
- func (n *NodeLocal) Value(k string) (string, bool)
- type Protocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinServiceName ¶
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func (*Cluster) ServiceEndpoints ¶
type Configuration ¶
type Configuration struct { Name string `json:"name" yaml:"name" usage:"Cluster name"` IP string `json:"ip" yaml:"ip" usage:"Cluster ip"` Prefix string `json:"prefex" yaml:"prefix" usage:"prefix"` Port int `` /* 154-byte string literal not displayed */ Address string `` /* 156-byte string literal not displayed */ Protocol string `` /* 198-byte string literal not displayed */ ServiceName string `yaml:"service_name" json:"service_name" usage:"Service name."` ServiceDomain string `yaml:"service_domain" json:"service_domain" usage:"Service domain."` SSLCertificate string `` /* 192-byte string literal not displayed */ SSLPrivateKey string `` /* 192-byte string literal not displayed */ Etcd EtcdConfiguration `json:"etcd" yaml:"etcd" usage:"Etcd settings"` }
func NewConfiguration ¶
func NewConfiguration() Configuration
func (Configuration) Check ¶
func (c Configuration) Check() error
type EtcdConfiguration ¶
type EtcdConfiguration struct { Endpoints []string `json:"endpoints" yaml:"endpoints" usage:"Etcd address a list of URLs."` DialTimeout int `json:"dial_timeout" yaml:"dial_timeout" usage:"The timeout for failing to establish a connection."` DialKeepAliveTime int `` /* 138-byte string literal not displayed */ Username string `json:"username" yaml:"username" usage:"A user name for authentication"` Password string `json:"password" yaml:"password" usage:"A password for authentication"` Cert string `json:"cert" yaml:"cert" usage:"The client secure credentials"` Key string `json:"key" yaml:"key" usage:"The client secure credentials"` CACert string `json:"ca_cert" yaml:"ca_cert" usage:"The client secure credentials"` }
type Node ¶
type Node interface { // 获取节点唯一编号 ID() string // 获取节点所支持的协议 Protocol() Protocol // 节点服务名称 Service() string // 是否为子服务 Sub() bool // 获取节点的地址以及服务商品 Address() string // 获取节点中附加的参数信息 Value(k string) (string, bool) // 设置节点的附加信息 SetValue(k, v string) // 编码节点信息 Marshal() (string, error) // 解码节点信息 Unmarshal(s string) error }
Node 节点信息
Click to show internal directories.
Click to hide internal directories.