# Functions
CacheDiscovery caches the services in a file, it will return the cached services if the number of services is greater than threshold.
CalculateWeight converts the rtt to weighted by: 1.
FailModeString retrieves an enum value from the enum constants string name.
FailModeValues returns all values of the enum.
Hash consistently chooses a hash bucket number in the range [0, numBuckets) for the given key.
HashString get a hash value of a string.
JumpConsistentHash selects a server by serviceMethod and args.
NewBidirectionalOneClient creates a new xclient that can receive notifications from servers.
NewBidirectionalOneClientPool creates a BidirectionalOneClient pool with fixed size.
NewBidirectionalXClient creates a new xclient that can receive notifications from servers.
NewBidirectionalXClientPool creates a BidirectionalXClient pool with fixed size.
NewClient returns a new Client with the option.
NewConsecCircuitBreaker returns a new ConsecCircuitBreaker.
NewDNSDiscovery returns a new DNSDiscovery.
NewMDNSDiscovery returns a new MDNSDiscovery.
NewMultipleServersDiscovery returns a new MultipleServersDiscovery.
NewOneClient creates a OneClient that supports service discovery and service governance.
NewOneClientPool creates a fixed size OneClient pool.
NewPeer2PeerDiscovery returns a new Peer2PeerDiscovery.
NewServiceError creates a ServiceError with the error message.
NewXClient creates a XClient that supports service discovery and service governance.
NewXClientPool creates a fixed size XClient pool.
Ping gets network traffic by ICMP.
SelectModeString retrieves an enum value from the enum constants string name.
SelectModeValues returns all values of the enum.
# Constants
Closest is selecting the closest server.
ConsistentHash is selecting by hashing.
Failbackup select another server if the first server doesn't respond in specified time and use the fast response.
Failfast returns error immediately.
Failover selects another server automaticaly.
Failtry use current client again.
RandomSelect is selecting randomly.
ReaderBuffsize is used for bufio reader.
RoundRobin is selecting by round robin.
SelectByUser is selecting by implementation of users.
WeightedICMP is selecting by weighted Ping time.
WeightedRoundRobin is selecting by weighted round robin.
WriterBuffsize is used for bufio writer.
# Variables
CircuitBreaker is a default circuit breaker (RateBreaker(0.95, 100)).
ClientErrorFunc is a function to create a customized error.
DefaultOption is a common option configuration for client.
ErrServerUnavailable selected server is unavailable.
ErrShutdown connection is closed.
ErrShutdown connection is closed.
ErrXClientNoServer selector can't found one server.
ErrXClientShutdown xclient is shutdown.
# Structs
Call represents an active RPC.
Client represents a RPC client.
ConsecCircuitBreaker is window sliding CircuitBreaker with failure threshold.
DNSDiscovery is based on DNS a record.
KVPair contains a key and a string.
MDNSDiscovery is a mdns service discovery.
MultipleServersDiscovery is a multiple servers service discovery.
OneClient wraps servicesPath and XClients.
OneClientPool is a oneclient pool with fixed size.
Option contains all options for creating clients.
Peer2PeerDiscovery is a peer-to-peer service discovery.
Receipt represents the result of the service returned.
Weighted is a wrapped server with weight.
XClientPool is a xclient pool with fixed size.
# Interfaces
Breaker is a CircuitBreaker interface.
CacheClientBuilder defines builder interface to generate RPCCient.
Plugin is the client plugin interface.
RPCClient is interface that defines one client to call one server.
Selector defines selector that selects one service from candidates.
ServiceDiscovery defines ServiceDiscovery of zookeeper, etcd and consul.
ServiceError is an error from server.
XClient is an interface that used by client with service discovery and service governance.
# Type aliases
ConsistentFunction define a hash function Return service address, like "[email protected]:8970".
FailMode decides how clients action when clients fail to invoke services.
HashServiceAndArgs define a hash function.
SelectMode defines the algorithm of selecting a services from candidates.
ServiceDiscoveryFilter can be used to filter services with customized logics.