Documentation ¶
Index ¶
- Constants
- Variables
- func InitManager(s *model.Storage) chan struct{}
- type Manager
- func (mgr *Manager) AddDynamicAuditPlan(...) error
- func (mgr *Manager) AddStaticAuditPlan(name, cronExp, dbType, currentUserName, auditPlanType string, ps params.Params) error
- func (mgr *Manager) DeleteAuditPlan(name string) error
- func (mgr *Manager) TriggerAuditPlan(name string) (*model.AuditPlanReport, error)
- func (mgr *Manager) UpdateAuditPlan(name string, attrs map[string]interface{}) error
- type Meta
Constants ¶
View Source
const ( TypeMySQLSlowLog = "mysql_slow_log" TypeMySQLMybatis = "mysql_mybatis" TypeDefault = "default" )
View Source
const ( InstanceTypeAll = "" InstanceTypeMySQL = "mysql" )
Variables ¶
View Source
var ErrAuditPlanExisted = errors.New("audit plan existed")
View Source
var ErrAuditPlanNotExist = errors.New("audit plan not exist")
View Source
var MetaMap = map[string]Meta{}
View Source
var Metas = []Meta{ { Type: TypeDefault, Desc: "自定义", InstanceType: InstanceTypeAll, }, { Type: TypeMySQLSlowLog, Desc: "慢日志", InstanceType: InstanceTypeMySQL, }, { Type: TypeMySQLMybatis, Desc: "Mybatis 扫描", InstanceType: InstanceTypeMySQL, }, }
Functions ¶
func InitManager ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the struct managing the persistent AuditPlans. It is *goroutine-safe*, since all exported methods are protected by a lock.
All audit plan operations except select should go through Manager.
func GetManager ¶
func GetManager() *Manager
func (*Manager) AddDynamicAuditPlan ¶
func (*Manager) AddStaticAuditPlan ¶
func (*Manager) DeleteAuditPlan ¶
func (*Manager) TriggerAuditPlan ¶
func (mgr *Manager) TriggerAuditPlan(name string) (*model.AuditPlanReport, error)
Click to show internal directories.
Click to hide internal directories.