Documentation ¶
Index ¶
Constants ¶
View Source
const ( DISCOVERY_DEFAULT_INTERVAL = 3 DISCOVERY_DEFAULT_TTL = 10 DEFAULT_RPC_TIMEOUT = 30 )
Variables ¶
View Source
var (
DefaultMaxMsgSize = 512 * 1024 * 1024 //default allow 512 MiB data transport
)
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, maxSize ...int) (g *GoRPC)
sizes: max send or receive msg size in byte
type RegistryType ¶
type RegistryType int
const ( RegistryType_MDNS RegistryType = 0 // multicast DNS RegistryType_ETCD RegistryType = 1 // etcd )
func (RegistryType) String ¶
func (t RegistryType) String() string
Click to show internal directories.
Click to hide internal directories.