Documentation
¶
Index ¶
Constants ¶
View Source
const ( DISCOVERY_DEFAULT_INTERVAL = 3 DISCOVERY_DEFAULT_TTL = 10 DEFAULT_RPC_TIMEOUT = 30 )
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext get metadata from context
Types ¶
type Discovery ¶
type Discovery struct {
ServiceName string // register service name [required]
RpcAddr string // register server RPC address [required]
Interval int // register interval default 3 seconds [optional]
TTL int // register TTL default 10 seconds [optional]
Endpoints []string // register endpoints of etcd/consul/zookeeper eg. ["192.168.0.10:2379","192.168.0.11:2379"]
}
type GoRPC ¶
type GoRPC struct {
// contains filtered or unexported fields
}
func NewGoRPC ¶
func NewGoRPC(registryType RegistryType) (g *GoRPC)
type RegistryType ¶
type RegistryType int
const ( RegistryType_MDNS RegistryType = 0 // multicast DNS RegistryType_ETCD RegistryType = 1 // etcd RegistryType_CONSUL RegistryType = 2 // consul RegistryType_ZOOKEEPER RegistryType = 3 // zookeeper )
func (RegistryType) String ¶
func (t RegistryType) String() string
Click to show internal directories.
Click to hide internal directories.