audit

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRecord

func CreateRecord(username, module, action, target, targetUuid, detail, sourceIp string) error

CreateRecord 创建审计日志记录

func GetSourceIp

func GetSourceIp(c *gin.Context) string

GetSourceIp 从 gin 上下文获取来源 IP

func GetUsername

func GetUsername(c *gin.Context) string

GetUsername 从 gin 上下文获取当前登录用户名

func List

func List(c *gin.Context, in *ListRequest)

List 审计日志列表

func LogWithContext

func LogWithContext(c *gin.Context, module, action, target, targetUuid, detail string)

LogWithContext 使用 gin.Context 自动提取用户名和来源 IP 并记录审计日志

Types

type ListRequest

type ListRequest struct {
	Keyword string `json:"keyword"`
	Module  string `json:"module"`
	Action  string `json:"action"`
	Page    int    `json:"page" default:"1"`
	PerPage int    `json:"per_page" default:"20"`
}

Jump to

Keyboard shortcuts

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