Documentation ¶
Index ¶
- Variables
- type Cache
- func (c *Cache) BatchGet(keys []string) ([]*CacheItem, error)
- func (c *Cache) BatchGetWithContext(ctx context.Context, keys []string) ([]*CacheItem, error)
- func (c *Cache) BatchSet(pairs map[string]interface{}) error
- func (c *Cache) BatchSetWithContext(ctx context.Context, pairs map[string]interface{}) error
- func (c *Cache) Del(key string) error
- func (c *Cache) DelWithContext(ctx context.Context, key string) error
- func (c *Cache) Get(key string) (*CacheItem, error)
- func (c *Cache) GetWithContext(ctx context.Context, key string) (*CacheItem, error)
- func (c *Cache) Set(key string, value interface{}) error
- func (c *Cache) SetWithContext(ctx context.Context, key string, value interface{}) error
- type CacheItem
- type FinishStorageOp
- type StartStorageOp
- type Storage
- type StorageMaker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFulfilled = errors.New("look up not fulfilled") ErrPartiallyFulfilled = errors.New("look up only partially fulfilled") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(maker StorageMaker, otherMakers ...StorageMaker) (*Cache, error)
func CreateWithHooks ¶ added in v0.2.1
func CreateWithHooks(sop StartStorageOp, fop FinishStorageOp, maker StorageMaker, otherMakers ...StorageMaker) (*Cache, error)
func (*Cache) BatchGetWithContext ¶ added in v0.1.2
func (*Cache) BatchSetWithContext ¶ added in v0.1.2
func (*Cache) DelWithContext ¶ added in v0.1.2
func (*Cache) GetWithContext ¶ added in v0.1.2
type FinishStorageOp ¶ added in v0.2.1
type FinishStorageOp func(interface{})
type StartStorageOp ¶ added in v0.2.1
type Storage ¶
type Storage interface { TimeToLive() time.Duration Get(ctx context.Context, key string) *CacheItem BatchGet(ctx context.Context, keys []string) []*CacheItem Set(ctx context.Context, key string, value []byte) error BatchSet(ctx context.Context, pairs map[string][]byte) error Del(ctx context.Context, key string) error }
type StorageMaker ¶
Click to show internal directories.
Click to hide internal directories.