redis

package
v0.0.0-...-e5d1c0a Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*option)

func WithTrace

func WithTrace(t Trace) Option

WithTrace 设置trace信息

type RedisStore

type RedisStore struct {
	Expiration time.Duration
	PreKey     string
	Context    core.Context
	Cache      Repo
}

func NewCaptchaRedisStore

func NewCaptchaRedisStore(cache Repo, ctx core.Context) *RedisStore

func (*RedisStore) Get

func (rs *RedisStore) Get(key string, clear bool) string

func (*RedisStore) Set

func (rs *RedisStore) Set(id string, value string) error

func (*RedisStore) Verify

func (rs *RedisStore) Verify(id, answer string, clear bool) bool

type Repo

type Repo interface {
	Set(key, value string, ttl time.Duration, options ...Option) error
	Get(key string, options ...Option) (string, error)
	TTL(key string) (time.Duration, error)
	Expire(key string, ttl time.Duration) bool
	ExpireAt(key string, ttl time.Time) bool
	Del(key string, options ...Option) bool
	Exists(keys ...string) bool
	Incr(key string, options ...Option) int64
	Close() error
	Version() string
	IncrByProject(key string, options ...Option) int64
	GetTable(table string, options ...Option) (*model.Table, error)
	GetTableById(table int, options ...Option) (*model.Table, error)
	GetColumn(colId int, options ...Option) (*model.Column, error)
	GetDict(dict string, options ...Option) (*model.Dict, error)
	GerUserMenu(userId int64, options ...Option) (*[]model.Menu, error)
	// contains filtered or unexported methods
}

func New

func New() (Repo, error)

type Trace

type Trace = trace.T

Jump to

Keyboard shortcuts

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