Documentation
¶
Index ¶
- Constants
- Variables
- func InitAsynqScheduler(c config.RedisConf) *asynq.Scheduler
- func InitAsynqServer(c config.RedisConf) *asynq.Server
- func InitAsynqTasks(ctx *ServiceContext, Mux *asynq.ServeMux, Ctx context.Context)
- func InitRedisClient(c config.RedisConf) (redisClient *redis.Client)
- func NewTaskSyncExtCompPreMap() (*asynq.Task, error)
- type ServiceContext
Constants ¶
View Source
const (
TypeSyncExtCompPreMap = "uuap:syncExtCompPreMap"
)
Variables ¶
View Source
var (
ExtCompPreMap sync.Map
)
Functions ¶
func InitAsynqScheduler ¶
InitAsynqScheduler 初始化定时任务 asynq client scheduler 用来注册定时任务送入队列
func InitAsynqServer ¶
InitAsynqServer 初始化定时任务 asynq server 用来启动 worker 处理任务
func InitAsynqTasks ¶
func InitAsynqTasks(ctx *ServiceContext, Mux *asynq.ServeMux, Ctx context.Context)
InitAsynqTasks 初始化asynq任务
func InitRedisClient ¶
InitRedisClient 初始化redis客户端
func NewTaskSyncExtCompPreMap ¶
NewTaskSyncExtCompPreMap 初始化刷新外部公司账号英文前缀映射缓存
Types ¶
type ServiceContext ¶
type ServiceContext struct { Config config.Config // 依赖中间件 Engine *gorm.DB RedisClient *redis.Client AsynqServer *asynq.Server AsynqScheduler *asynq.Scheduler LdapUserAttrModel model.LdapUserAttrModel }
func NewServiceContext ¶
func NewServiceContext(c config.Config) *ServiceContext
func (*ServiceContext) HandleTaskSyncExtCompPreMap ¶
HandleTaskSyncExtCompPreMap 注册handler
func (*ServiceContext) LoadExtCompPreMap ¶
func (s *ServiceContext) LoadExtCompPreMap(ctx context.Context) (err error)
LoadExtCompPreMap 获取外部公司账号前缀映射
Click to show internal directories.
Click to hide internal directories.