Lines Matching defs:cache

1 package cache  package
36 *cache anonMember
40 type cache struct { struct
41 defaultExpiration time.Duration
42 items map[string]Item
43 mu sync.RWMutex
44 onEvicted func(string, interface{})
45 janitor *janitor
51 func (c *cache) Set(k string, x interface{}, d time.Duration) {
70 func (c *cache) set(k string, x interface{}, d time.Duration) {
86 func (c *cache) SetDefault(k string, x interface{}) {
92 func (c *cache) Add(k string, x interface{}, d time.Duration) error {
106 func (c *cache) Replace(k string, x interface{}, d time.Duration) error {
120 func (c *cache) Get(k string) (interface{}, bool) {
142 func (c *cache) GetWithExpiration(k string) (interface{}, time.Time, bool) {
168 func (c *cache) get(k string) (interface{}, bool) {
187 func (c *cache) Increment(k string, n int64) error {
235 func (c *cache) IncrementFloat(k string, n float64) error {
259 func (c *cache) IncrementInt(k string, n int) (int, error) {
281 func (c *cache) IncrementInt8(k string, n int8) (int8, error) {
303 func (c *cache) IncrementInt16(k string, n int16) (int16, error) {
325 func (c *cache) IncrementInt32(k string, n int32) (int32, error) {
347 func (c *cache) IncrementInt64(k string, n int64) (int64, error) {
369 func (c *cache) IncrementUint(k string, n uint) (uint, error) {
391 func (c *cache) IncrementUintptr(k string, n uintptr) (uintptr, error) {
413 func (c *cache) IncrementUint8(k string, n uint8) (uint8, error) {
435 func (c *cache) IncrementUint16(k string, n uint16) (uint16, error) {
457 func (c *cache) IncrementUint32(k string, n uint32) (uint32, error) {
479 func (c *cache) IncrementUint64(k string, n uint64) (uint64, error) {
501 func (c *cache) IncrementFloat32(k string, n float32) (float32, error) {
523 func (c *cache) IncrementFloat64(k string, n float64) (float64, error) {
547 func (c *cache) Decrement(k string, n int64) error {
597 func (c *cache) DecrementFloat(k string, n float64) error {
621 func (c *cache) DecrementInt(k string, n int) (int, error) {
643 func (c *cache) DecrementInt8(k string, n int8) (int8, error) {
665 func (c *cache) DecrementInt16(k string, n int16) (int16, error) {
687 func (c *cache) DecrementInt32(k string, n int32) (int32, error) {
709 func (c *cache) DecrementInt64(k string, n int64) (int64, error) {
731 func (c *cache) DecrementUint(k string, n uint) (uint, error) {
753 func (c *cache) DecrementUintptr(k string, n uintptr) (uintptr, error) {
775 func (c *cache) DecrementUint8(k string, n uint8) (uint8, error) {
797 func (c *cache) DecrementUint16(k string, n uint16) (uint16, error) {
819 func (c *cache) DecrementUint32(k string, n uint32) (uint32, error) {
841 func (c *cache) DecrementUint64(k string, n uint64) (uint64, error) {
863 func (c *cache) DecrementFloat32(k string, n float32) (float32, error) {
885 func (c *cache) DecrementFloat64(k string, n float64) (float64, error) {
905 func (c *cache) Delete(k string) {
914 func (c *cache) delete(k string) (interface{}, bool) {
931 func (c *cache) DeleteExpired() {
953 func (c *cache) OnEvicted(f func(string, interface{})) {
963 func (c *cache) Save(w io.Writer) (err error) {
984 func (c *cache) SaveFile(fname string) error {
1002 func (c *cache) Load(r io.Reader) error {
1024 func (c *cache) LoadFile(fname string) error {
1038 func (c *cache) Items() map[string]Item {
1057 func (c *cache) ItemCount() int {
1065 func (c *cache) Flush() {
1093 func runJanitor(c *cache, ci time.Duration) {