store.go 419 B

123456789101112131415
  1. package store
  2. import (
  3. "context"
  4. )
  5. // Store is the interface of a cache backend
  6. type Store interface {
  7. // Get retrieves an item from the cache. Returns the item or nil, and a bool indicating
  8. // whether the key was found.
  9. Get(ctx context.Context, key string) ([]byte, error)
  10. // Set sets an item to the cache, replacing any existing item.
  11. Set(ctx context.Context, key string, value []byte, expire int32) error
  12. }