Documentation ¶
Index ¶
- Constants
- func Run(ctx context.Context, rediscli *redis.Client, db *database.Database, ...) error
- type AlertRuleSyncTasker
- func (t *AlertRuleSyncTasker) CheckAlertRuleConfig(ctx context.Context) error
- func (s *AlertRuleSyncTasker) Crontasks() map[string]Task
- func (t *AlertRuleSyncTasker) ProvideFuntions() map[string]interface{}
- func (t *AlertRuleSyncTasker) SyncAlertRuleState(ctx context.Context) error
- func (t *AlertRuleSyncTasker) SyncSystemAlertRule(ctx context.Context) error
- type ApplicationTasker
- type ClusterSyncTasker
- type CronTask
- type CronTasker
- type HelmSyncTasker
- type ProcessorContext
- type SampleTasker
- type Task
- type TaskArchiverTasker
- type Tasker
Constants ¶
View Source
const ( TaskFunction_SyncAlertRuleState = "sync-alertrule-state" TaskFunction_CheckAlertRuleConfig = "check-alertrule-config" TaskFunction_SyncSystemAlertRule = "sync-system-alertrule" )
View Source
const RemoveConsumerDuration = 5 * time.Minute
View Source
const TaskFunction_ArchiveTasks = "task-archive"
View Source
const TaskFunction_ClusterSync = "cluster-sync"
View Source
const TaskFunction_HelmSyncCharts = "helm-sync-charts"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlertRuleSyncTasker ¶ added in v1.23.0
func (*AlertRuleSyncTasker) CheckAlertRuleConfig ¶ added in v1.23.0
func (t *AlertRuleSyncTasker) CheckAlertRuleConfig(ctx context.Context) error
func (*AlertRuleSyncTasker) Crontasks ¶ added in v1.23.0
func (s *AlertRuleSyncTasker) Crontasks() map[string]Task
func (*AlertRuleSyncTasker) ProvideFuntions ¶ added in v1.23.0
func (t *AlertRuleSyncTasker) ProvideFuntions() map[string]interface{}
func (*AlertRuleSyncTasker) SyncAlertRuleState ¶ added in v1.23.0
func (t *AlertRuleSyncTasker) SyncAlertRuleState(ctx context.Context) error
func (*AlertRuleSyncTasker) SyncSystemAlertRule ¶ added in v1.23.0
func (t *AlertRuleSyncTasker) SyncSystemAlertRule(ctx context.Context) error
type ApplicationTasker ¶
type ApplicationTasker struct {
*application.ApplicationProcessor
}
func (*ApplicationTasker) ProvideFuntions ¶
func (t *ApplicationTasker) ProvideFuntions() map[string]interface{}
type ClusterSyncTasker ¶ added in v1.22.0
func (*ClusterSyncTasker) Crontasks ¶ added in v1.22.0
func (s *ClusterSyncTasker) Crontasks() map[string]Task
func (*ClusterSyncTasker) ProvideFuntions ¶ added in v1.22.0
func (t *ClusterSyncTasker) ProvideFuntions() map[string]interface{}
type CronTasker ¶
某些任务处理本身会有定时任务,可以实现该接口
type HelmSyncTasker ¶
func (*HelmSyncTasker) Crontasks ¶
func (s *HelmSyncTasker) Crontasks() map[string]Task
func (*HelmSyncTasker) ProvideFuntions ¶
func (t *HelmSyncTasker) ProvideFuntions() map[string]interface{}
func (*HelmSyncTasker) SyncCharts ¶
func (t *HelmSyncTasker) SyncCharts(ctx context.Context) error
type ProcessorContext ¶
func (*ProcessorContext) RegisterTasker ¶
func (p *ProcessorContext) RegisterTasker(taskers ...Tasker) error
func (*ProcessorContext) RunCronTasksWithLock ¶
func (p *ProcessorContext) RunCronTasksWithLock(ctx context.Context) error
由于worker是多副本的,且crontask 只能在 worker上运行cron。 为了避免多个worker都执行,使用redis 锁选择一个worker来触发这些crontask
type SampleTasker ¶
type SampleTasker struct{}
func (*SampleTasker) Crontasks ¶
func (s *SampleTasker) Crontasks() map[string]Task
func (*SampleTasker) ProvideFuntions ¶
func (s *SampleTasker) ProvideFuntions() map[string]interface{}
type TaskArchiverTasker ¶
type TaskArchiverTasker struct { Databse *database.Database Redis *redis.Client // contains filtered or unexported fields }
用于转移超过时间的任务记录至database
func NewTaskArchiverTasker ¶
func NewTaskArchiverTasker(databse *database.Database, redis *redis.Client) *TaskArchiverTasker
func (*TaskArchiverTasker) ArchiveOutdated ¶
func (t *TaskArchiverTasker) ArchiveOutdated(ctx context.Context) error
func (*TaskArchiverTasker) Crontasks ¶
func (t *TaskArchiverTasker) Crontasks() map[string]Task
func (*TaskArchiverTasker) ProvideFuntions ¶
func (t *TaskArchiverTasker) ProvideFuntions() map[string]interface{}
func (*TaskArchiverTasker) RemoveOffline ¶
func (t *TaskArchiverTasker) RemoveOffline(ctx context.Context) error
RemoveOffline 删除长时间不活跃的worker正在处理的任务
Click to show internal directories.
Click to hide internal directories.