mgocache

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKey

func DefaultKey(s string) string

func NewCache

func NewCache(col *mgo.Collection, f func(string) string) cache.Cache

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func (*Cache) ClearAll

func (p *Cache) ClearAll() (err error)

func (*Cache) Close

func (p *Cache) Close() error

func (*Cache) Delete

func (p *Cache) Delete(key string)

func (*Cache) Get

func (p *Cache) Get(key string) ([]byte, bool)

func (*Cache) GetRange

func (p *Cache) GetRange(key string, low, high int64) (b []byte, ok bool)

func (*Cache) Set

func (p *Cache) Set(key string, value []byte)

func (*Cache) SetTimeout

func (p *Cache) SetTimeout(key string, value []byte, timeout time.Duration) error

type MgoCache

type MgoCache struct {
	// contains filtered or unexported fields
}

func New

func New(db *mgo.Database, name string, f func(string) string) *MgoCache

func (*MgoCache) ClearAll

func (p *MgoCache) ClearAll() (err error)

func (*MgoCache) Close

func (p *MgoCache) Close() error

func (*MgoCache) Delete

func (p *MgoCache) Delete(key string)

func (*MgoCache) Get

func (p *MgoCache) Get(key string) ([]byte, bool)

func (*MgoCache) GetRange

func (p *MgoCache) GetRange(key string, low, high int64) (b []byte, ok bool)

func (*MgoCache) Set

func (p *MgoCache) Set(key string, value []byte)

func (*MgoCache) SetTimeout

func (p *MgoCache) SetTimeout(key string, value []byte, timeout time.Duration)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL