You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gojobs/jobs_gorm_get.go

27 lines
546 B

package gojobs
import (
"github.com/go-redis/redis/v9"
"gorm.io/gorm"
)
// GetDb 获取数据库驱动
func (j *JobsGorm) GetDb() *gorm.DB {
return j.gormClient.Db
}
// GetRedis 获取缓存数据库驱动
func (j *JobsGorm) GetRedis() *redis.Client {
return j.redisClient.Db
}
// GetCurrentIp 获取当前ip
func (j *JobsGorm) GetCurrentIp() string {
return j.config.outsideIp
}
// GetSubscribeAddress 获取订阅地址
func (j *JobsGorm) GetSubscribeAddress() string {
return j.config.cornKeyPrefix + "_" + j.config.cornKeyCustom
}