Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Start(ctx context.Context) error
Stop(ctx context.Context) error
Type() string
Get(ctx context.Context, key string) (*string, error)
GetOrSet(ctx context.Context, key, value string, ttl time.Duration) (storedValue *string, retrieved bool, err error)
GetAndDelete(ctx context.Context, key string) (deletedValue *string, exists bool, err error)
Set(ctx context.Context, key, value string, ttl time.Duration) error
Delete(ctx context.Context, key string) error
}
func NewCache ¶
func NewCache(cacheType Type, config *RawMessage, log logrus.FieldLogger) (Cache, error)
type Config ¶
type Config struct {
Type Type `yaml:"type" default:"memory"`
Config *RawMessage `yaml:"config"`
}
type RawMessage ¶
type RawMessage struct {
// contains filtered or unexported fields
}
func (*RawMessage) Unmarshal ¶
func (r *RawMessage) Unmarshal(v interface{}) error
func (*RawMessage) UnmarshalYAML ¶
func (r *RawMessage) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.