audit_logs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLogRepository

type AuditLogRepository interface {
	Create(ctx context.Context, audit_log models.AuditLog) error
}

type AuditLogRequest

type AuditLogRequest struct {
	UserID         int64  `json:"user_id"`
	Path           string `json:"path"`
	Action         string `json:"action"`
	ResponseStatus int    `json:"response_status"`
	ModuleID       string `json:"module_id"`
	Module         string `json:"module"`
	BeforeChange   any    `json:"before_change"`
	AfterChange    any    `json:"after_change"`
	IPAddress      string `json:"ip_address"`
	UserAgent      string `json:"user_agent"`
	ErrorMessage   string `json:"error_message"`
}

type AuditLogService

type AuditLogService interface {
	QueAuditLog(ctx context.Context)
	AuditLog(audit AuditLogRequest, module_id, module string, beforeChange, afterChange any, err error)
}

func NewAuditLogService

func NewAuditLogService(r AuditLogRepository) AuditLogService

type MockAuditLogRepository

type MockAuditLogRepository struct {
	CreateFunc func(ctx context.Context, audit_log models.AuditLog) error
}

func (*MockAuditLogRepository) Create

func (m *MockAuditLogRepository) Create(ctx context.Context, audit_log models.AuditLog) error

type MockAuditLogService

type MockAuditLogService struct {
}

func (*MockAuditLogService) AuditLog

func (m *MockAuditLogService) AuditLog(audit AuditLogRequest, module_id, module string, beforeChange, afterChange any, err error)

func (*MockAuditLogService) QueAuditLog

func (m *MockAuditLogService) QueAuditLog(ctx context.Context)

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewAuditLogRepository

func NewAuditLogRepository(db *bun.DB) *Repository

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, auditLog models.AuditLog) error

Jump to

Keyboard shortcuts

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