audit

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NormalRating of trace
	NormalRating traceRating = "Normal"
	// WarningRating of trace
	WarningRating traceRating = "Warning"
	// IncidentRating of trace
	IncidentRating traceRating = "Incident"

	// ConsoleActionType of trace
	ConsoleActionType TraceType = "ConsoleAction"
	// APICallType of trace
	APICallType TraceType = "ApiCall"
	// SystemAction of trace
	SystemAction TraceType = "SystemAction"
)

Variables

View Source
var FakeAuditLogger fake

FakeAuditLogger of the unit test

Functions

func Error

func Error(info AuditLogInfo)

Error log of audit

func Fault

func Fault(info AuditLogInfo)

Fault log of audit

func Info

func Info(info AuditLogInfo)

Info log of audit

func InitAuditLog

func InitAuditLog(config AuditLogConfig) error

InitAuditLog from config

func SetAuditLog

func SetAuditLog(l AuditLog)

SetAuditLog with specific logs

Types

type AuditLog

type AuditLog interface {
	// contains filtered or unexported methods
}

AuditLog interface for expand

type AuditLogConfig

type AuditLogConfig struct {
	AppName  string
	Filename string
	MaxSize  int64
}

AuditLogConfig of audit

func DefaultAuditLogConfig

func DefaultAuditLogConfig() AuditLogConfig

DefaultAuditLogConfig get the default audit log config

type AuditLogInfo

type AuditLogInfo struct {
	Timestamp    int64
	SourceIP     string
	ResourceType string
	ResourceName string
	TraceName    string
	TraceRating  traceRating
	TraceType    TraceType
	Message      string
}

AuditLogInfo of each audit basic messages

type TraceType

type TraceType string

Jump to

Keyboard shortcuts

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