add cache interface

cache
chenzhihui 2 years ago
parent 8743f3e50c
commit 315d3048bf
  1. 13
      cache/cache.go

13
cache/cache.go vendored

@ -0,0 +1,13 @@
package cache
import (
"context"
"time"
)
// Cache is a generic key value cache interface.
type Cache interface {
Get(ctx context.Context, key string) (interface{}, error)
Put(ctx context.Context, key string, value interface{}, expired time.Duration) error
Delete(ctx context.Context, key string) error
}
Loading…
Cancel
Save