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

23 lines
415 B

package gojobs
import (
"github.com/go-redis/redis/v8"
"go.etcd.io/etcd/client/v3"
"gorm.io/gorm"
)
// GetDb 数据库驱动
func (j *JobsGorm) GetDb() *gorm.DB {
return j.service.gormClient
}
// GetRedis 缓存数据库驱动
func (j *JobsGorm) GetRedis() *redis.Client {
return j.db.redisClient
}
// GetEtcd 分布式缓存驱动
func (j *JobsGorm) GetEtcd() *clientv3.Client {
return j.db.etcdClient
}