audit

package
v0.0.0-...-2c311f4 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "audit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLog

type AuditLog struct {
	Id string `bson:"_id" json:"id"`
	// 谁
	Username string `bson:"username" json:"username"`
	// 什么时间
	Time int64 `bson:"time" json:"time"`
	// 访问那个功能
	ServiceId string `bson:"service_id" json:"service_id"`
	// 操作
	Operate string `bson:"operate" json:"operate"`
	// 具体的请求内容
	Request string `bson:"request" json:"request"`
}

审计日志

func LoadAuditLogFromJosn

func LoadAuditLogFromJosn(data []byte) (*AuditLog, error)

func NewAuditLog

func NewAuditLog() *AuditLog

func (*AuditLog) String

func (s *AuditLog) String() string

func (*AuditLog) ToJsonByte

func (s *AuditLog) ToJsonByte() []byte

type AuditLogSet

type AuditLogSet struct {
	Total int64       `json:"total"`
	Items []*AuditLog `json:"items"`
}

type QueryAuditLogRequest

type QueryAuditLogRequest struct {
}

type Service

type Service interface {
	// 日志保存
	SaveAuditLog(context.Context, *AuditLog) (*AuditLog, error)
	// 日志查询
	QueryAuditLog(context.Context, *QueryAuditLogRequest) (*AuditLogSet, error)
}

审计日志接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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