Documentation ¶
Index ¶
- Constants
- Variables
- func AddFingerPrint(data map[string]interface{}) error
- func AddRule(data map[string]interface{}) error
- func DeleteFingerPrint(id uint) error
- func DeleteRule(id uint) error
- func GetEventInfo(query map[string]interface{}) (map[string]interface{}, error)
- func GetEvents(query map[string]interface{}, page int, pageSize int) (map[string]interface{}, error)
- func GetFingerPrintCount(query map[string]interface{}) (int, error)
- func GetRuleCount(query map[string]interface{}) (int, error)
- func OpenDatabase(cfg *config.DataBase, _storage storage.Storage) error
- func SaveEvent(body interface{}) error
- func UpdateFingerPrint(id uint, data map[string]interface{}) error
- func UpdateRule(id uint, data map[string]interface{}) error
- type FingerPrint
- type Model
- type Rule
Constants ¶
View Source
const ( SORT_UNKNOWN = iota TIME_DESC TIME_ASC PRIORITY_DESC PRIORITY_ASC )
Variables ¶
View Source
var Storage storage.Storage
Functions ¶
func AddFingerPrint ¶
func DeleteFingerPrint ¶
func DeleteRule ¶
func GetEventInfo ¶
func GetFingerPrintCount ¶
func GetRuleCount ¶
func UpdateFingerPrint ¶
func UpdateRule ¶
Types ¶
type FingerPrint ¶
type FingerPrint struct { Model Name string `json:"name" gorm:"column:name;not null"` FingerPrint string `json:"fingerprint" gorm:"column:fingerprint;unique;default:''"` Remark string `json:"remark" gorm:"column:remark;"` }
func GetFingerPrint ¶
func GetFingerPrint(id uint) (*FingerPrint, error)
func GetFingerPrints ¶
func GetFingerPrints(query map[string]interface{}, page int, pageSize int) ([]*FingerPrint, error)
type Rule ¶
type Rule struct { Model Name string `json:"name" gorm:"column:name;not null"` Time int `json:"time" gorm:"column:time"` Type int `json:"type" gorm:"column:type;default 0"` User string `json:"user" gorm:"column:user;default:''"` IP string `json:"ip" gorm:"column:ip;default:''"` Db string `json:"db" gorm:"column:db;default:''"` RuleType int `json:"ruletype" gorm:"column:ruletype;not null"` Op int `json:"op" gorm:"column:op;default:0"` Alert int `json:"alert" gorm:"column:alert;default:0"` Sql string `json:"sql" gorm:"column:sql;default:''"` Match int `json:"match" gorm:"column:match;default:0"` Priority int `json:"priority" gorm:"column:priority;default:0"` Remark string `json:"remark" gorm:"column:remark;"` }
export const sqlOptions = [
{ key: 1, value: 'SELECT' }, { key: 2, value: 'UNION' }, { key: 3, value: 'INSERT' }, { key: 4, value: 'UPDATE' }, { key: 5, value: 'DELETE' }, { key: 6, value: 'DDL' }, { key: 7, value: 'SHOW' }, { key: 8, value: 'USE' }, { key: 9, value: 'SET' }, { key: 10, value: 'BEGIN' }, { key: 11, value: 'COMMIT' }, { key: 12, value: 'ROLLBACK' }, { key: 13, value: 'OTHERREAD' }, { key: 14, value: 'OTHERADMIN' }
]
Click to show internal directories.
Click to hide internal directories.