Versions in this module Expand all Collapse all v4 v4.0.0 Jan 21, 2021 Changes in this version + func RegisterNewGroupHook(fn func(*Group)) + func RegisterPeerPicker(fn func() PeerPicker) + func RegisterPerGroupPeerPicker(fn func(groupName string) PeerPicker) + func RegisterServerStart(fn func()) + type AtomicInt int64 + func (i *AtomicInt) Add(n int64) + func (i *AtomicInt) Get() int64 + func (i *AtomicInt) String() string + type ByteView struct + func (v ByteView) At(i int) byte + func (v ByteView) ByteSlice() []byte + func (v ByteView) Copy(dest []byte) int + func (v ByteView) Equal(b2 ByteView) bool + func (v ByteView) EqualBytes(b2 []byte) bool + func (v ByteView) EqualString(s string) bool + func (v ByteView) Expire() time.Time + func (v ByteView) Len() int + func (v ByteView) ReadAt(p []byte, off int64) (n int, err error) + func (v ByteView) Reader() io.ReadSeeker + func (v ByteView) Slice(from, to int) ByteView + func (v ByteView) SliceFrom(from int) ByteView + func (v ByteView) String() string + func (v ByteView) WriteTo(w io.Writer) (n int64, err error) + type CacheStats struct + Bytes int64 + Evictions int64 + Gets int64 + Hits int64 + Items int64 + type CacheType int + const HotCache + const MainCache + type Getter interface + Get func(ctx context.Context, key string, dest Sink) error + type GetterFunc func(ctx context.Context, key string, dest Sink) error + func (f GetterFunc) Get(ctx context.Context, key string, dest Sink) error + type Group struct + Stats Stats + func GetGroup(name string) *Group + func NewGroup(name string, cacheBytes int64, getter Getter) *Group + func (g *Group) CacheStats(which CacheType) CacheStats + func (g *Group) Get(ctx context.Context, key string, dest Sink, bypassCache bool) error + func (g *Group) Name() string + func (g *Group) Remove(ctx context.Context, key string) error + type HTTPPool struct + func NewHTTPPool(self string) *HTTPPool + func NewHTTPPoolOpts(self string, o *HTTPPoolOptions) *HTTPPool + func (p *HTTPPool) GetAll() []ProtoGetter + func (p *HTTPPool) PickPeer(key string) (ProtoGetter, bool) + func (p *HTTPPool) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (p *HTTPPool) Set(peers ...string) + type HTTPPoolOptions struct + BasePath string + Context func(*http.Request) context.Context + HashFn consistenthash.Hash + Replicas int + Transport func(context.Context) http.RoundTripper + type NoPeers struct + func (NoPeers) GetAll() []ProtoGetter + func (NoPeers) PickPeer(key string) (peer ProtoGetter, ok bool) + type PeerPicker interface + GetAll func() []ProtoGetter + PickPeer func(key string) (peer ProtoGetter, ok bool) + type ProtoGetter interface + Get func(context context.Context, in *pb.GetRequest, out *pb.GetResponse, ...) error + Remove func(context context.Context, in *pb.GetRequest) error + type Sink interface + SetBytes func(v []byte, e time.Time) error + SetProto func(m proto.Message, e time.Time) error + SetString func(s string, e time.Time) error + func AllocatingByteSliceSink(dst *[]byte) Sink + func ByteViewSink(dst *ByteView) Sink + func ProtoSink(m proto.Message) Sink + func StringSink(sp *string) Sink + func TruncatingByteSliceSink(dst *[]byte) Sink + type Stats struct + CacheHits AtomicInt + Gets AtomicInt + Loads AtomicInt + LoadsDeduped AtomicInt + LocalLoadErrs AtomicInt + LocalLoads AtomicInt + PeerErrors AtomicInt + PeerLoads AtomicInt + ServerRequests AtomicInt Other modules containing this package github.com/chatlio/groupcache/v3