svc

package
v0.0.0-...-205be16 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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

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

NewTaskC7nCacheProject c7n缓存项目任务

func NewTaskC7nCacheRole

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

NewTaskC7nCacheRole c7n缓存角色任务

func NewTaskC7nSyncLdapUser

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

NewTaskC7nSyncLdapUser c7n同步ldap用户

func NewTaskWeworkScanExpireUser

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

NewTaskWeworkScanExpireUser 企业微信扫描过期用户任务

func NewTaskWeworkSyncUser

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

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 (s *ServiceContext) HandleTaskC7nCacheProject(ctx context.Context, t *asynq.Task) (err error)

func (*ServiceContext) HandleTaskC7nCacheRole

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

func (*ServiceContext) HandleTaskC7nSyncLdapUser

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

func (*ServiceContext) HandleTaskWeworkScanExpireUser

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

HandleTaskWeworkScanExpireUser 扫描企业微信过期用户 外部人员根据过期标识,过期标识临近则发送提醒

func (*ServiceContext) HandleTaskWeworkSyncUser

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

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 加载企业微信用户缓存

Jump to

Keyboard shortcuts

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