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
}
ByteView holds immutable view of bytes
type Getter ¶
Getter describes user defined function used to get data when data not exists in the cache
type GetterFunc ¶
GetterFunc is a function which implements Getter interface
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is a cache namespace and associated data loaded spread over
func GetGroup ¶
GetGroup return the group according to the specified group name if there is not a group named as name, it returns nil
func (*Group) RegisterPeers ¶
func (g *Group) RegisterPeers(peers PeerPicker)
RegisterPeers registers a PeerPicker for choosing remote peer
type HTTPPool ¶
type HTTPPool struct {
// contains filtered or unexported fields
}
HTTPPool is a http server contains a peer's name and path
func NewHTTPPool ¶
NewHTTPPool creates an instace of http server which is used to communicate with the other peers
func (*HTTPPool) PickPeer ¶
func (pool *HTTPPool) PickPeer(key string) (PeerGetter, bool)
PickPeer picks a peer according to the specified key
type PeerGetter ¶
PeerGetter is the interface that must be implemented by a peer
type PeerPicker ¶
type PeerPicker interface {
PickPeer(key string) (PeerGetter, bool)
}
PeerPicker is the interface that must be implemented to locate the peer that specified by the key