cache - ActiveState ActiveGo 1.8
...

Package cache

import "github.com/coreos/etcd/proxy/grpcproxy/cache"
Overview
Index

Overview ▾

Package cache exports functionality for efficiently caching and mapping `RangeRequest`s to corresponding `RangeResponse`s.

Variables

var (
    DefaultMaxEntries = 2048
    ErrCompacted      = rpctypes.ErrGRPCCompacted
)

type Cache

type Cache interface {
    Add(req *pb.RangeRequest, resp *pb.RangeResponse)
    Get(req *pb.RangeRequest) (*pb.RangeResponse, error)
    Compact(revision int64)
    Invalidate(key []byte, endkey []byte)
    Size() int
    Close()
}

func NewCache

func NewCache(maxCacheEntries int) Cache