Documentation ¶
Index ¶
- Variables
- func FromExpiration(ctx context.Context) (time.Duration, bool)
- func FromKey(ctx context.Context) (string, bool)
- func New(config ...Config) gorm.Plugin
- func NewExpiration(ctx context.Context, ttl time.Duration) context.Context
- func NewKey(ctx context.Context, key string) context.Context
- type Config
- type Serializer
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDefault = Config{ Storage: memory.New(), Serializer: &serializers.JSONSerializer{}, Prefix: "gobp:cache:", KeyGenerator: func(s string) string { return s }, Expires: time.Hour, }
ConfigDefault is the default config
View Source
var (
ErrMissingKey = errors.New("missing key on storage")
)
Functions ¶
Types ¶
type Serializer ¶
Click to show internal directories.
Click to hide internal directories.