conn

package
v0.0.0-...-6f70ee3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MulanPSL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 分布式锁键格式
	CacheKey_LockFmt = "lock:%s:string"
	// 分片上传文件
	CacheKey_UploadFiles = "upload:files:hash"
	// 记录唯一id缓存键
	CacheKey_GenIdFmt = "gen:id:%s:set"
	// 分片上传信息
	CacheKey_UploadPartFmt = "upload:part:%s:sset"
	// 定时任务记录
	CacheKey_CronRecordFmt = "cron:%s:%s"
	// 用户会话
	CacheKey_UserSessionFmt = "user:session:%s:%s:string"
	// 登陆失败次数记录
	CacheKey_UserLoginFailTimesFmt = "user:login:fail:times:%s:string"
)

Variables

This section is empty.

Functions

func AutoMigrateAllTable

func AutoMigrateAllTable(ctx context.Context) error

AutoMigrateAllTable 创建数据库表结构

func CloseMysqlClient

func CloseMysqlClient(ctx context.Context)

CloseMysqlClient 断开连接

func CloseRabbitMQClient

func CloseRabbitMQClient(ctx context.Context)

CloseRabbitMQClient 关闭连接

func CloseRedisClient

func CloseRedisClient(ctx context.Context)

CloseRedisClient 关闭连接

func GetMySQLClient

func GetMySQLClient(ctx context.Context) *gorm.DB

GetMySQLClient 获取MySQL客户端

func GetRabbitMQChannel

func GetRabbitMQChannel(ctx context.Context) *amqp091.Channel

GetRabbitMQChannel 获取RabbitMQ通道

func GetRedisClient

func GetRedisClient(ctx context.Context) *redis.Client

GetRedisClient 获取Redis客户端

func GetTusClient

func GetTusClient(ctx context.Context) tus_client.TusClient

GetTusClient 获取tus客户端

func HasLock

func HasLock(ctx context.Context, key string) bool

HasLock 是否加锁了

func InitialMySQL

func InitialMySQL(ctx context.Context, user, pass, host, port, db string, maxIdea, maxOpen int)

InitialMySQL 初始化MySQL

func InitialRabbitMQ

func InitialRabbitMQ(ctx context.Context, uri string)

InitialRabbitMQ 初始化RabbitMQ

func InitialRedis

func InitialRedis(ctx context.Context, addr, passwd string, db int)

InitialRedis 初始化Redis

func InitialTusClient

func InitialTusClient(ctx context.Context, host string)

InitialTusClient 初始化tus客户端

func Lock

func Lock(ctx context.Context, key string, timeout time.Duration) bool

Lock 加锁

func LockWait

func LockWait(ctx context.Context, key string, wait time.Duration) bool

LockWait 加锁

func Unlock

func Unlock(ctx context.Context, key string)

Unlock 解锁

func WaitUnlock

func WaitUnlock(ctx context.Context, key string, max time.Duration) bool

WaitUnlock 等待锁释放

Types

This section is empty.

Jump to

Keyboard shortcuts

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