Versions in this module Expand all Collapse all v0 v0.0.33 Feb 2, 2023 v0.0.32 Nov 22, 2022 v0.0.31 Nov 22, 2022 v0.0.30 Nov 22, 2022 v0.0.29 Sep 15, 2022 v0.0.28 Sep 2, 2022 v0.0.27 Sep 1, 2022 Changes in this version type Client + ConsistentHash func(key, url string) (string, error) + Random func(url string) (string, error) + RoundRobin func(url string) (string, error) type RpcClient + func (s *RpcClient) ConsistentHash(key, url string) (string, error) + func (s *RpcClient) Random(url string) (string, error) + func (s *RpcClient) RoundRobin(url string) (string, error) v0.0.23 Dec 7, 2021 v0.0.22 Dec 7, 2021 Changes in this version type HttpClient + Url string v0.0.21 Sep 2, 2021 v0.0.20 Aug 16, 2021 v0.0.19 May 7, 2021 v0.0.18 Apr 27, 2021 v0.0.17 Mar 14, 2021 v0.0.15 Mar 11, 2021 Changes in this version + func NewClient(address string) (*rpc.Client, error) + func NewGobClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec + func NewGobServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec + func NewJsonClient(address string) (*rpc.Client, error) + func NewJsonClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec + func NewJsonServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec + func TimeoutCoder(f func(interface{}) error, e interface{}, msg string) error + type Client interface + Hash func(url, key string) (string, error) + HashRing func(url, key string) (string, error) + Robin func(url string) (string, error) + Round func(url string) (string, error) + Services func(serviceName string, state StateType) Service + func RiffClient(url string) (Client, error) + type CmdType int + const CmdRestart + const CmdStart + const CmdStop + func CmdType_FromName(name string) CmdType + func (c CmdType) Name() string + func (c CmdType) Value() int + type HashKey uint32 + type HashKeyOrder []HashKey + func (h HashKeyOrder) Len() int + func (h HashKeyOrder) Less(i, j int) bool + func (h HashKeyOrder) Swap(i, j int) + type HashRing struct + func New(nodes []string) *HashRing + func NewWithWeights(weights map[string]int) *HashRing + func (h *HashRing) AddNode(node string) *HashRing + func (h *HashRing) AddWeightedNode(node string, weight int) *HashRing + func (h *HashRing) GenKey(key string) HashKey + func (h *HashRing) GetNode(stringKey string) (node string, ok bool) + func (h *HashRing) GetNodePos(stringKey string) (pos int, ok bool) + func (h *HashRing) GetNodes(stringKey string, size int) (nodes []string, ok bool) + func (h *HashRing) RemoveNode(node string) *HashRing + func (h *HashRing) Size() int + func (h *HashRing) UpdateWeightedNode(node string, weight int) *HashRing + func (h *HashRing) UpdateWithWeights(weights map[string]int) + type HttpClient struct + type NestNode struct + Config string + DataCenter string + IP string + IsSelf bool + Name string + Port int + Progress *NestProgress + RpcPort int + SnapShot string + StartTime time.Time + State StateType + StatusContent string + Version int + type NestNodes []*NestNode + type NestProgress struct + Current int32 + InProgress bool + Total int32 + type NestService struct + Config string + IP string + Name string + Port int + Progress *NestProgress + StartTime time.Time + State StateType + StatusContent string + type NestServices []*NestService + type Node struct + DataCenter string + HttpPort int + IP string + IsSelf bool + Name string + RpcPort int + SnapShot string + State StateType + Version int + type Nodes []*Node + type ParamNode struct + Name string + type ParamService struct + Name string + State StateType + type ParamServiceMutation struct + Cmd CmdType + Name string + type Progress func(int32, int32) + type RPCType byte + const RPCGob + const RPCJson + type RpcClient struct + func (this *RpcClient) Hash(url, key string) (string, error) + func (this *RpcClient) HashRing(url, key string) (string, error) + func (this *RpcClient) Robin(url string) (string, error) + func (this *RpcClient) Round(url string) (string, error) + func (this *RpcClient) Services(name string, state StateType) (service Service) + type Service struct + Name string + type Services []*Service + type StateType int + const StateAlive + const StateAll + const StateDead + const StateSuspect + func StateType_FromName(name string) StateType + func (s StateType) Name() string + func (s StateType) Value() int