Documentation ¶
Index ¶
- func RegisterPeerPicker(fn func() PeerPicker)
- type Cache
- func (c *Cache) Clear()
- func (c *Cache) Contains(key string) bool
- func (c *Cache) Delete(ctx Context, key string) error
- func (c *Cache) FilterCount() uint64
- func (c *Cache) Get(ctx Context, key string) ([]byte, error)
- func (c *Cache) GetFilterStats() *FilterStats
- func (c *Cache) GetStats() *Stats
- func (c *Cache) Len() int
- func (c *Cache) MaxSize() (maxSize int64)
- func (c *Cache) Peers(peers PeerPicker) *Cache
- func (c *Cache) ResetFilter()
- func (c *Cache) Set(ctx Context, key string, data []byte) error
- func (c *Cache) Size() (size int64)
- type Context
- type CuckooFilter
- type Entry
- type FilterStats
- type Getter
- type GetterFunc
- type HTTPPool
- type HTTPPoolOptions
- type LRFU
- func (lru *LRFU) Clear()
- func (lru *LRFU) Get(key uint64) (value []byte, ok bool)
- func (lru *LRFU) Len() int
- func (lru *LRFU) Remove(key uint64) (ok bool)
- func (lru *LRFU) RemoveElement()
- func (lru *LRFU) Set(key uint64, value []byte)
- func (lru *LRFU) SetEvictedFunc(f func(key uint64, value []byte))
- type NoPeers
- type PeerPicker
- type Policy
- type ProtoGetter
- type Response
- type Shard
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPeerPicker ¶
func RegisterPeerPicker(fn func() PeerPicker)
Types ¶
type Cache ¶
func (*Cache) Peers ¶
func (c *Cache) Peers(peers PeerPicker) *Cache
Sets function to be used as data loader
type CuckooFilter ¶
type CuckooFilter struct {
// contains filtered or unexported fields
}
func NewCuckoo ¶
func NewCuckoo(capacity uint) *CuckooFilter
type FilterStats ¶
func NewFilterStats ¶
func NewFilterStats() *FilterStats
type GetterFunc ¶
Function to be used as data loader
type HTTPPool ¶
type HTTPPool struct { Context func(*http.Request) Context Transport func(Context) http.RoundTripper // contains filtered or unexported fields }
func NewHTTPPool ¶
func NewHTTPPoolOpts ¶
func NewHTTPPoolOpts(self string, o *HTTPPoolOptions) *HTTPPool
func (*HTTPPool) DecrementLoad ¶
func (p *HTTPPool) DecrementLoad()
func (*HTTPPool) IncrementLoad ¶
func (p *HTTPPool) IncrementLoad()
type HTTPPoolOptions ¶
type LRFU ¶
type LRFU struct { OnEvicted func(key uint64, value []byte) // contains filtered or unexported fields }
This is not thread-safe, which means it will depend on the parent implementation to do the locking mechanism.
func (*LRFU) RemoveElement ¶
func (lru *LRFU) RemoveElement()
func (*LRFU) SetEvictedFunc ¶
type NoPeers ¶
type NoPeers struct{}
func (NoPeers) DecrementLoad ¶
func (NoPeers) DecrementLoad()
func (NoPeers) IncrementLoad ¶
func (NoPeers) IncrementLoad()
type PeerPicker ¶
type PeerPicker interface { PickPeer(key string) (peer ProtoGetter, ok bool) IncrementLoad() DecrementLoad() GetLoad() uint64 }
type Policy ¶
type Policy interface { Set(uint64, []byte) Get(uint64) ([]byte, bool) Len() int Remove(uint64) bool Clear() RemoveElement() SetEvictedFunc(func(key uint64, value []byte)) }
All policies implemented (or wish to be implemented) for hermes follows this interface.
type ProtoGetter ¶
type ProtoGetter interface { Get(context Context, in *pb.GetRequest, out *pb.GetResponse) error Set(context Context, in *pb.SetRequest, out *pb.SetResponse) error Delete(context Context, in *pb.DeleteRequest, out *pb.DeleteResponse) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.