Documentation ¶
Index ¶
- Constants
- func AutoMigrateAllTable(ctx context.Context) error
- func CloseMysqlClient(ctx context.Context)
- func CloseRabbitMQClient(ctx context.Context)
- func CloseRedisClient(ctx context.Context)
- func GetMySQLClient(ctx context.Context) *gorm.DB
- func GetRabbitMQChannel(ctx context.Context) *amqp091.Channel
- func GetRedisClient(ctx context.Context) *redis.Client
- func GetTusClient(ctx context.Context) tus_client.TusClient
- func HasLock(ctx context.Context, key string) bool
- func InitialMySQL(ctx context.Context, user, pass, host, port, db string, maxIdea, maxOpen int)
- func InitialRabbitMQ(ctx context.Context, uri string)
- func InitialRedis(ctx context.Context, addr, passwd string, db int)
- func InitialTusClient(ctx context.Context, host string)
- func Lock(ctx context.Context, key string, timeout time.Duration) bool
- func LockWait(ctx context.Context, key string, wait time.Duration) bool
- func Unlock(ctx context.Context, key string)
- func WaitUnlock(ctx context.Context, key string, max time.Duration) bool
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 ¶
AutoMigrateAllTable 创建数据库表结构
func GetRabbitMQChannel ¶
GetRabbitMQChannel 获取RabbitMQ通道
func GetRedisClient ¶
GetRedisClient 获取Redis客户端
func GetTusClient ¶
func GetTusClient(ctx context.Context) tus_client.TusClient
GetTusClient 获取tus客户端
func InitialMySQL ¶
InitialMySQL 初始化MySQL
func InitialRabbitMQ ¶
InitialRabbitMQ 初始化RabbitMQ
func InitialRedis ¶
InitialRedis 初始化Redis
func InitialTusClient ¶
InitialTusClient 初始化tus客户端
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.