svc

package
v0.0.0-...-65d8ea5 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeSyncExtCompPreMap = "uuap:syncExtCompPreMap"
)

Variables

View Source
var (
	ExtCompPreMap sync.Map
)

Functions

func InitAsynqScheduler

func InitAsynqScheduler(c config.RedisConf) *asynq.Scheduler

InitAsynqScheduler 初始化定时任务 asynq client scheduler 用来注册定时任务送入队列

func InitAsynqServer

func InitAsynqServer(c config.RedisConf) *asynq.Server

InitAsynqServer 初始化定时任务 asynq server 用来启动 worker 处理任务

func InitAsynqTasks

func InitAsynqTasks(ctx *ServiceContext, Mux *asynq.ServeMux, Ctx context.Context)

InitAsynqTasks 初始化asynq任务

func InitRedisClient

func InitRedisClient(c config.RedisConf) (redisClient *redis.Client)

InitRedisClient 初始化redis客户端

func NewTaskSyncExtCompPreMap

func NewTaskSyncExtCompPreMap() (*asynq.Task, error)

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

func (s *ServiceContext) HandleTaskSyncExtCompPreMap(ctx context.Context, t *asynq.Task) error

HandleTaskSyncExtCompPreMap 注册handler

func (*ServiceContext) LoadExtCompPreMap

func (s *ServiceContext) LoadExtCompPreMap(ctx context.Context) (err error)

LoadExtCompPreMap 获取外部公司账号前缀映射

Jump to

Keyboard shortcuts

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