util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Data data
View Source
var (
	ErrDataIsEmpty = errors.New("数据不可为空")
)
View Source
var Str str

Functions

func ClientPasswordHash

func ClientPasswordHash(email, password string) string

Types

type Cache

type Cache interface {
	GetKey(tab constant.CacheTab, unique string) string
	Init() error
	Get(key string) (interface{}, bool)
	GetInt(key string) (int, bool)
	Set(key string, value interface{}, duration time.Duration)
	Increment(key string, number int64) error
	Close() error
	Delete(key string) error
}

type LocalCache

type LocalCache struct {
	local_cache.Cache
	// contains filtered or unexported fields
}

func (*LocalCache) Close

func (r *LocalCache) Close() error

func (*LocalCache) Delete

func (r *LocalCache) Delete(key string) error

func (*LocalCache) GetInt

func (rc *LocalCache) GetInt(key string) (int, bool)

func (*LocalCache) GetKey

func (cb *LocalCache) GetKey(tab constant.CacheTab, unique string) string

func (*LocalCache) Init

func (r *LocalCache) Init() error

type RedisCache

type RedisCache struct {
	DB       int
	Addr     string
	Password string
	// contains filtered or unexported fields
}

func (*RedisCache) Close

func (rc *RedisCache) Close() error

func (*RedisCache) Delete

func (rc *RedisCache) Delete(key string) error

func (*RedisCache) Get

func (rc *RedisCache) Get(key string) (interface{}, bool)

func (*RedisCache) GetInt

func (rc *RedisCache) GetInt(key string) (result int, isSuccess bool)

func (*RedisCache) GetKey

func (cb *RedisCache) GetKey(tab constant.CacheTab, unique string) string

func (*RedisCache) Increment

func (rc *RedisCache) Increment(key string, number int64) error

func (*RedisCache) Init

func (rc *RedisCache) Init() error

func (*RedisCache) Set

func (rc *RedisCache) Set(key string, value interface{}, duration time.Duration)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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