audits

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2020 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionLogin = "LOGIN" // 登录 {ip}
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action = string

动作

type Log

type Log struct {
	Id          shared.ObjectId   `bson:"_id" json:"id"` // 数据库存储的ID
	Username    string            `bson:"username" json:"username"`
	Action      Action            `bson:"action" json:"action"`           // 类型
	Description string            `bson:"description" json:"description"` // 描述
	Options     map[string]string `bson:"options" json:"options"`         // 选项
	Timestamp   int64             `bson:"timestamp" json:"timestamp"`     // 时间戳
}

审计日志

func NewLog

func NewLog(username string, action Action, description string, options map[string]string) *Log

获取新审计日志对象

func (*Log) ActionName

func (this *Log) ActionName() string

审计日志类型

func (*Log) DBColumns

func (this *Log) DBColumns() maps.Map

获取数据库列值

func (*Log) SetDBColumns

func (this *Log) SetDBColumns(v maps.Map)

设置数据库列值

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL