Documentation ¶
Index ¶
- Constants
- Variables
- func InitAsynqTasks(ctx *ServiceContext, Mux *asynq.ServeMux, Ctx context.Context)
- func InitWeworkCorpAPIWorkFlow(c config.WeworkConf) *api.CorpAPI
- func InitZYWeworkAPIWorkFlow(c config.WeworkConf) *api.CorpAPI
- func NewTaskC7nCacheProject() (*asynq.Task, error)
- func NewTaskC7nCacheRole() (*asynq.Task, error)
- func NewTaskC7nSyncLdapUser() (*asynq.Task, error)
- func NewTaskWeworkScanExpireUser() (*asynq.Task, error)
- func NewTaskWeworkSyncUser() (*asynq.Task, error)
- func SendRobotMsg(s *ServiceContext, msg string) (err error)
- func SendWeworkMsg(s *ServiceContext, uid, tplKey string, args ...interface{}) (err error)
- type ServiceContext
- func (s *ServiceContext) HandleTaskC7nCacheProject(ctx context.Context, t *asynq.Task) (err error)
- func (s *ServiceContext) HandleTaskC7nCacheRole(ctx context.Context, t *asynq.Task) (err error)
- func (s *ServiceContext) HandleTaskC7nSyncLdapUser(ctx context.Context, t *asynq.Task) (err error)
- func (s *ServiceContext) HandleTaskWeworkScanExpireUser(ctx context.Context, t *asynq.Task) (err error)
- func (s *ServiceContext) HandleTaskWeworkSyncUser(ctx context.Context, t *asynq.Task) (err error)
- func (s *ServiceContext) LoadC7nProject(ctx context.Context) (err error)
- func (s *ServiceContext) LoadC7nRole(ctx context.Context) (err error)
- func (s *ServiceContext) LoadExtCompPreMap(ctx context.Context) (err error)
- func (s *ServiceContext) LoadWeworkUser(ctx context.Context) (err error)
Constants ¶
View Source
const ( TypeC7nSyncLdapUser = "c7n:syncLdapUser" TypeC7nCacheRole = "c7n:cacheC7nRole" TypeC7nCacheProject = "c7n:cacheC7nProject" TypeWeworkSyncUser = "wework:syncWeworkUser" TypeWeworkScanExpireUser = "wework:scanExpireUser" )
Variables ¶
View Source
var (
ExtCompPreMap sync.Map
)
Functions ¶
func InitAsynqTasks ¶
func InitAsynqTasks(ctx *ServiceContext, Mux *asynq.ServeMux, Ctx context.Context)
InitAsynqTasks 初始化asynq任务
func InitWeworkCorpAPIWorkFlow ¶
func InitWeworkCorpAPIWorkFlow(c config.WeworkConf) *api.CorpAPI
InitWeworkCorpAPIWorkFlow 初始化企业微信 workflow应用api
func InitZYWeworkAPIWorkFlow ¶
func InitZYWeworkAPIWorkFlow(c config.WeworkConf) *api.CorpAPI
InitZYWeworkAPIWorkFlow 初始化企业微信 workflow应用api
func NewTaskC7nCacheProject ¶
NewTaskC7nCacheProject c7n缓存项目任务
func NewTaskC7nCacheRole ¶
NewTaskC7nCacheRole c7n缓存角色任务
func NewTaskC7nSyncLdapUser ¶
NewTaskC7nSyncLdapUser c7n同步ldap用户
func NewTaskWeworkScanExpireUser ¶
NewTaskWeworkScanExpireUser 企业微信扫描过期用户任务
func NewTaskWeworkSyncUser ¶
NewTaskWeworkSyncUser 企业微信更新用户任务
func SendRobotMsg ¶
func SendRobotMsg(s *ServiceContext, msg string) (err error)
SendRobotMsg 发送机器人信息
func SendWeworkMsg ¶
func SendWeworkMsg(s *ServiceContext, uid, tplKey string, args ...interface{}) (err error)
SendWeworkMsg 发送企业微信消息 userid 企业微信用户id; tpl 消息模版
Types ¶
type ServiceContext ¶
type ServiceContext struct { Config config.Config // 中间件 RedisClient *redis.Client AsynqServer *asynq.Server AsynqScheduler *asynq.Scheduler CorpAPIWorkFlow *api.CorpAPI ZYWeworkAPIWorkFlow *api.CorpAPI // model CPlusModel model.CPlusModel WeworkUserModel model.WeworkUserModel VolcUserModel model.VolcUserModel }
func NewServiceContext ¶
func NewServiceContext(c config.Config) *ServiceContext
func (*ServiceContext) HandleTaskC7nCacheProject ¶
func (*ServiceContext) HandleTaskC7nCacheRole ¶
func (*ServiceContext) HandleTaskC7nSyncLdapUser ¶
func (*ServiceContext) HandleTaskWeworkScanExpireUser ¶
func (s *ServiceContext) HandleTaskWeworkScanExpireUser(ctx context.Context, t *asynq.Task) (err error)
HandleTaskWeworkScanExpireUser 扫描企业微信过期用户 外部人员根据过期标识,过期标识临近则发送提醒
func (*ServiceContext) HandleTaskWeworkSyncUser ¶
HandleTaskWeworkSyncUser 注册handler
func (*ServiceContext) LoadC7nProject ¶
func (s *ServiceContext) LoadC7nProject(ctx context.Context) (err error)
LoadC7nProject 初始化猪齿鱼项目缓存
func (*ServiceContext) LoadC7nRole ¶
func (s *ServiceContext) LoadC7nRole(ctx context.Context) (err error)
LoadC7nRole 初始化c7n角色
func (*ServiceContext) LoadExtCompPreMap ¶
func (s *ServiceContext) LoadExtCompPreMap(ctx context.Context) (err error)
LoadExtCompPreMap 获取外部公司账号前缀映射
func (*ServiceContext) LoadWeworkUser ¶
func (s *ServiceContext) LoadWeworkUser(ctx context.Context) (err error)
LoadWeworkUser 加载企业微信用户缓存
Click to show internal directories.
Click to hide internal directories.