Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteView ¶
type ByteView struct {
// contains filtered or unexported fields
}
A ByteView holds an immutable view of bytes.
type GetterFunc ¶
A GetterFunc implements Getter with a function.
type HTTPPool ¶
type HTTPPool struct {
// contains filtered or unexported fields
}
HTTPPool implements PeerPicker for a pool of HTTP peers.
func NewHTTPPool ¶
NewHTTPPool initializes an HTTP pool of peers.
func (*HTTPPool) PickPeer ¶
func (p *HTTPPool) PickPeer(key string) (PeerGetter, bool)
PickPeer picks a peer according to key
type PeerGetter ¶
PeerGetter is the interface that must be implemented by a peer.
type PeerPicker ¶
type PeerPicker interface {
PickPeer(key string) (peer PeerGetter, ok bool)
}
PeerPicker is the interface that must be implemented to locate the peer that owns a specific key.
type Relation ¶
type Relation struct {
// contains filtered or unexported fields
}
A Relation is a Cache namespace and associated data loaded spread over.
func GetRelation ¶
GetRelation returns the named class previously created with NewRelation, or nil if there's no such class.
func NewRelation ¶
NewRelation create a new instance of Relation.
func (*Relation) RegisterPeers ¶
func (r *Relation) RegisterPeers(peers PeerPicker)
RegisterPeers registers a PeerPicker for choosing remote peer