cache

package
v0.0.0-...-bed3fb8 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Redis *redis.Client

Functions

func InitRedis

func InitRedis() error

func Warming

func Warming() error

Warming preload warm data into Redis

Types

type AllCache

type AllCache struct {
	RedSync  RedSync
	Building Building
	Dorm     Dorm
	Token    Token
}
var All AllCache

type Building

type Building struct{}

type Dorm

type Dorm struct{}

func (*Dorm) GetRemainNum

func (d *Dorm) GetRemainNum(ctx context.Context) (map[string]string, error)

type RedSync

type RedSync struct {
	// contains filtered or unexported fields
}

func (*RedSync) Init

func (r *RedSync) Init(client *redis.Client)

Init the distributed lock from client

func (*RedSync) NewMutex

func (r *RedSync) NewMutex(mutexName string) *redsync.Mutex

NewMutex get a distributed lock from name, for this project, mutexName will be the buildingId possible errors: Lock():

type Token

type Token struct{}

Jump to

Keyboard shortcuts

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