Documentation ¶
Index ¶
- func FromExpiration(ctx context.Context) (time.Duration, bool)
- func FromKey(ctx context.Context) (string, bool)
- func FromTag(ctx context.Context) (string, bool)
- func NewExpiration(ctx context.Context, ttl time.Duration) context.Context
- func NewKey(ctx context.Context, key string) context.Context
- func NewTag(ctx context.Context, key string) context.Context
- func QueryDB(tx *gorm.DB)
- type Memory
- func (m *Memory) Decrease(_ context.Context, key string) error
- func (m *Memory) Del(_ context.Context, key string) error
- func (m *Memory) Expire(_ context.Context, key string, dur time.Duration) error
- func (m *Memory) Get(_ context.Context, key string) (string, error)
- func (m *Memory) HashDel(_ context.Context, hk, key string) error
- func (m *Memory) HashGet(_ context.Context, hk, key string) (string, error)
- func (m *Memory) Increase(_ context.Context, key string) error
- func (m *Memory) Initialize(tx *gorm.DB) error
- func (*Memory) Name() string
- func (m *Memory) Query(tx *gorm.DB)
- func (m *Memory) QueryCache(ctx context.Context, key string, dest any) error
- func (m *Memory) RemoveFromTag(ctx context.Context, tag string) error
- func (m *Memory) SaveCache(ctx context.Context, key string, dest any, ttl time.Duration) error
- func (m *Memory) SaveTagKey(ctx context.Context, tag, key string) error
- func (m *Memory) Set(_ context.Context, key string, val any, expire time.Duration) error
- func (*Memory) String() string
- type Message
- func (m *Message) GetID() string
- func (m *Message) GetPrefix() (prefix string)
- func (m *Message) GetStream() string
- func (m *Message) GetValues() map[string]interface{}
- func (m *Message) SetID(id string)
- func (m *Message) SetPrefix(prefix string)
- func (m *Message) SetStream(stream string)
- func (m *Message) SetValues(values map[string]interface{})
- type Option
- type Options
- type Redis
- func (r *Redis) Decrease(ctx context.Context, key string) error
- func (r *Redis) Del(ctx context.Context, key string) error
- func (r *Redis) Expire(ctx context.Context, key string, dur time.Duration) error
- func (r *Redis) Get(ctx context.Context, key string) (string, error)
- func (r *Redis) GetClient() *redis.Client
- func (r *Redis) HashDel(ctx context.Context, hk, key string) error
- func (r *Redis) HashGet(ctx context.Context, hk, key string) (string, error)
- func (r *Redis) Increase(ctx context.Context, key string) error
- func (r *Redis) Initialize(tx *gorm.DB) error
- func (*Redis) Name() string
- func (r *Redis) Query(tx *gorm.DB)
- func (r *Redis) QueryCache(ctx context.Context, key string, dest any) error
- func (r *Redis) RemoveFromTag(ctx context.Context, tag string) error
- func (r *Redis) SaveCache(ctx context.Context, key string, dest any, ttl time.Duration) error
- func (r *Redis) SaveTagKey(ctx context.Context, tag, key string) error
- func (r *Redis) Set(ctx context.Context, key string, val interface{}, expire time.Duration) error
- func (*Redis) String() string
- type VerifyCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromExpiration ¶ added in v0.3.7
FromExpiration returns the expiration time from the context
func NewExpiration ¶ added in v0.3.7
NewExpiration creates a new context with the given expiration time
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func (*Memory) QueryCache ¶ added in v0.3.7
func (*Memory) RemoveFromTag ¶ added in v0.3.7
func (*Memory) SaveTagKey ¶ added in v0.3.7
type Option ¶ added in v0.3.7
type Option func(*Options)
func WithQueryCacheDuration ¶ added in v0.3.7
WithQueryCacheDuration 设置缓存时间
func WithQueryCacheKeys ¶ added in v0.3.7
WithQueryCacheKeys 设置缓存key
func WithQueryCachePrefix ¶ added in v0.3.7
WithQueryCachePrefix 设置缓存前缀
type Options ¶ added in v0.3.7
type Options struct { QueryCacheDuration time.Duration QueryCacheKeys []string QueryCachePrefix string }
func DefaultOptions ¶ added in v0.3.7
func DefaultOptions() Options
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis cache implement
func (*Redis) QueryCache ¶ added in v0.3.7
func (*Redis) RemoveFromTag ¶ added in v0.3.7
func (*Redis) SaveTagKey ¶ added in v0.3.7
type VerifyCode ¶ added in v0.4.6
type VerifyCode struct {
Cache storage.AdapterCache
}
func NewVerifyCode ¶ added in v0.4.6
func NewVerifyCode(cache storage.AdapterCache) *VerifyCode
NewVerifyCode create a new verify code
func (*VerifyCode) GenerateCode ¶ added in v0.4.6
func (*VerifyCode) VerifyCode ¶ added in v0.4.6
Click to show internal directories.
Click to hide internal directories.