Documentation ¶
Index ¶
- Constants
- Variables
- func Audit(l *logrus.Entry, task *model.Task, ruleTemplateName string) (err error)
- func AuditSQLByDBType(l *logrus.Entry, sql string, dbType string, ruleTemplateName string) (*model.Task, error)
- func AuditSQLByDriver(l *logrus.Entry, sql string, d driver.Driver) (*model.Task, error)
- func ExecuteWorkflow(workflow *model.Workflow, userId uint) error
- func HookAudit(l *logrus.Entry, task *model.Task, hook AuditHook, ruleTemplateName string) (err error)
- func InitSqled(exit chan struct{})
- type AuditHook
- type EmptyAuditHook
- type Sqled
- func (s *Sqled) AddTask(taskId string, typ int) error
- func (s *Sqled) AddTaskWaitResult(taskId string, typ int) (*model.Task, error)
- func (s *Sqled) CleanExpiredTasks(entry *logrus.Entry)
- func (s *Sqled) CleanExpiredWorkflows(entry *logrus.Entry)
- func (s *Sqled) HasTask(taskId string) bool
- func (s *Sqled) Start()
- func (s *Sqled) WorkflowSchedule(entry *logrus.Entry)
Constants ¶
View Source
const ( ActionTypeAudit = iota + 1 ActionTypeExecute ActionTypeRollback )
View Source
const AuditSchema = "AuditSchema"
View Source
const (
SqlAuditTaskExpiredTime = 3 * 24 // 3 days
)
Variables ¶
View Source
var ( ErrActionExecuteOnExecutedTask = _errors.New("task has been executed, can not do execute on it") ErrActionExecuteOnNonAuditedTask = _errors.New("task has not been audited, can not do execute on it") ErrActionRollbackOnRollbackedTask = _errors.New("task has been rollbacked, can not do rollback on it") ErrActionRollbackOnExecuteFailedTask = _errors.New("task has been executed failed, can not do rollback on it") ErrActionRollbackOnNonExecutedTask = _errors.New("task has not been executed, can not do rollback on it") )
Functions ¶
func AuditSQLByDBType ¶ added in v1.2207.0
func AuditSQLByDriver ¶ added in v1.2207.0
func ExecuteWorkflow ¶ added in v1.2112.0
Types ¶
type AuditHook ¶ added in v1.2207.0
type AuditHook interface { BeforeAudit(sql *model.ExecuteSQL) AfterAudit(sql *model.ExecuteSQL) }
type EmptyAuditHook ¶ added in v1.2207.0
type EmptyAuditHook struct{}
func (*EmptyAuditHook) AfterAudit ¶ added in v1.2207.0
func (e *EmptyAuditHook) AfterAudit(sql *model.ExecuteSQL)
func (*EmptyAuditHook) BeforeAudit ¶ added in v1.2207.0
func (e *EmptyAuditHook) BeforeAudit(sql *model.ExecuteSQL)
type Sqled ¶
Sqled is an async task scheduling service. receive tasks from queue, the tasks include inspect, execute, rollback; and the task will only be executed once.
func (*Sqled) AddTaskWaitResult ¶
func (*Sqled) CleanExpiredTasks ¶
func (*Sqled) CleanExpiredWorkflows ¶
func (*Sqled) WorkflowSchedule ¶ added in v1.2112.0
Click to show internal directories.
Click to hide internal directories.