Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCacheMiss = errors.New("cache miss") ErrCacheFull = errors.New("cache full") )
Functions ¶
Types ¶
type Cache ¶
type Cache interface { Get(ctx context.Context, key string) ([]byte, error) Set(ctx context.Context, key string, value []byte, expire time.Duration) error Delete(ctx context.Context, key string) error Close(ctx context.Context) error }
func NewMemoryCache ¶
func NewMemoryCache() Cache
func NewRedisCache ¶
NewRedisCache creates a new redisCache instance.
Click to show internal directories.
Click to hide internal directories.