Documentation ¶
Index ¶
Constants ¶
View Source
const (
// SchedulerCallback ...
SchedulerCallback = "PURGE_AUDIT_LOG_CALLBACK"
)
Variables ¶
View Source
var Ctrl = NewController()
Ctrl a global purge controller instance
Functions ¶
Types ¶
type Controller ¶
type Controller interface { // Start kick off a purge schedule Start(ctx context.Context, policy JobPolicy, trigger string) (int64, error) // Stop a purge job Stop(ctx context.Context, id int64) error }
Controller defines the interface with the purge job
type JobPolicy ¶
type JobPolicy struct { Trigger *Trigger `json:"trigger"` DryRun bool `json:"dryrun"` RetentionHour int `json:"retention_hour"` IncludeOperations string `json:"include_operations"` ExtraAttrs map[string]interface{} `json:"extra_attrs"` }
JobPolicy defines the purge job policy
type Trigger ¶
type Trigger struct { Type TriggerType `json:"type"` Settings *TriggerSettings `json:"trigger_settings"` }
Trigger holds info for a trigger
type TriggerSettings ¶
type TriggerSettings struct {
Cron string `json:"cron"`
}
TriggerSettings is the setting about the trigger
Click to show internal directories.
Click to hide internal directories.