Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) Close() error
- func (c Client) Delete(key string) (string, error)
- func (c Client) Expire(key string, d time.Duration) (string, error)
- func (c Client) Get(key string) (string, error)
- func (c Client) Info() (string, error)
- func (c Client) Ping() error
- func (c Client) Set(key string, value string) (string, error)
- type ClientOptions
- type Cmd
- type CmdHandlers
- type ConsistentHash
- type HashAlgo
- type RendezvousHasher
- type Ring
- func (r *Ring) Close() error
- func (c Ring) Delete(key string) (string, error)
- func (c Ring) Expire(key string, d time.Duration) (string, error)
- func (c Ring) Get(key string) (string, error)
- func (c Ring) Info() (string, error)
- func (c Ring) Ping() error
- func (c Ring) Set(key string, value string) (string, error)
- type RingClientOpt
- type RingOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultAddress = "localhost:6767"
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(c ClientOptions) (*Client, error)
func NewDefaultClient ¶
type ClientOptions ¶
type CmdHandlers ¶
type CmdHandlers struct {
// contains filtered or unexported fields
}
type ConsistentHash ¶
type RendezvousHasher ¶
type RendezvousHasher struct {
*rendezvous.Rendezvous
}
func (RendezvousHasher) Get ¶
func (s RendezvousHasher) Get(input string) string
type Ring ¶
type Ring struct {
// contains filtered or unexported fields
}
func NewDefaultRing ¶
func NewRing ¶
func NewRing(opts RingOptions) (*Ring, error)
NewRing return a Ring behaves like a single client, with consistent hashing
type RingClientOpt ¶
type RingOptions ¶
type RingOptions struct { HealthCheckFrequency time.Duration Addresses []string HashAlgorithm HashAlgo ClientOptions RingClientOpt }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.