audit

package
v0.0.0-...-8431c9c Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogMgr = &LoggerManager{}

LogMgr manage the audit log forward operations

View Source
var Mgr = New()

Mgr is the global audit log manager instance

Functions

func CheckEndpointActive

func CheckEndpointActive(address string) bool

CheckEndpointActive check the liveliness of the endpoint

Types

type LoggerManager

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

LoggerManager manage the operations related to the audit log

func (*LoggerManager) DefaultLogger

func (a *LoggerManager) DefaultLogger(ctx context.Context) *log.Logger

DefaultLogger ...

func (*LoggerManager) Init

func (a *LoggerManager) Init(_ context.Context, logEndpoint string)

Init redirect the audit log to the forward endpoint

type Manager

type Manager interface {
	// Count returns the total count of audit logs according to the query
	Count(ctx context.Context, query *q.Query) (total int64, err error)
	// List audit logs according to the query
	List(ctx context.Context, query *q.Query) (audits []*model.AuditLog, err error)
	// Get the audit log specified by ID
	Get(ctx context.Context, id int64) (audit *model.AuditLog, err error)
	// Create the audit log
	Create(ctx context.Context, audit *model.AuditLog) (id int64, err error)
	// Delete the audit log specified by ID
	Delete(ctx context.Context, id int64) (err error)
	// Purge delete the audit log with retention hours
	Purge(ctx context.Context, retentionHour int, includeOperations []string, dryRun bool) (int64, error)
	// UpdateUsername Replace all log records username with its hash
	UpdateUsername(ctx context.Context, username string, replaceWith string) error
}

Manager is used for audit log management

func New

func New() Manager

New returns a default implementation of Manager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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