redisfetcher

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Set(key string, value interface{}, expiration time.Duration) error
	GetString(key string) (string, error)
	Get(key string, dst interface{}) error
	Del(key string) error
}

type Options

type Options struct {
	Group          *singleflight.Group
	GroupTimeout   time.Duration
	WithStackTrace bool
	DebugPrintMode bool
}

type RedisFetcher

type RedisFetcher interface {
	SetKey(prefixes []string, usedHash bool, elements ...string)
	Fetch(expiration time.Duration, dst interface{}, fetcher interface{}) (interface{}, error)
	SetVal(value interface{}, expiration time.Duration) error
	GetString() (string, error)
	GetVal(dst interface{}) (interface{}, error)
	DelVal() error
	Key() string
	IsCached() bool
}

func NewRedisFetcher

func NewRedisFetcher(client Client, options *Options) RedisFetcher

type SimpleClientImpl

type SimpleClientImpl struct {
	Client redis.UniversalClient
	Ctx    context.Context
}

func (*SimpleClientImpl) Del

func (i *SimpleClientImpl) Del(key string) error

func (*SimpleClientImpl) Get

func (i *SimpleClientImpl) Get(key string, dst interface{}) error

func (*SimpleClientImpl) GetString

func (i *SimpleClientImpl) GetString(key string) (string, error)

func (*SimpleClientImpl) Set

func (i *SimpleClientImpl) Set(key string, value interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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