store

package
v0.0.202 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

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"`
}

func (*Config) Validate

func (c *Config) Validate() error

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

type Type

type Type string
const (
	TypeUnknown      Type = "unknown"
	TypeMemory       Type = memory.Type
	TypeRedisServer  Type = redisServer.Type
	TypeRedisCluster Type = redisCluster.Type
)

Directories

Path Synopsis
redis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL