audit

package
v0.0.0-...-7935e33 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: BSD-3-Clause, MPL-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	LOG_TYPE_USER_CFG = iota
	LOG_TYPE_USER_CMD = iota
)

Variables

This section is empty.

Functions

func AssertUserLogSliceEqual

func AssertUserLogSliceEqual(t *testing.T, exp, act UserLogSlice)

func AssertUserLogSliceEqualSort

func AssertUserLogSliceEqualSort(t *testing.T, exp, act UserLogSlice)

func GetPidLoginuid

func GetPidLoginuid(pid int32) (uint32, error)

func LogUserCmd

func LogUserCmd(msg string, result uint)

func LogUserConfig

func LogUserConfig(msg string, result bool)

Types

type Audit

type Audit struct {
	Auditer
}

func NewAudit

func NewAudit() *Audit

func (Audit) LogUserCmd

func (a Audit) LogUserCmd(msg string, result uint)

func (Audit) LogUserConfig

func (a Audit) LogUserConfig(msg string, result bool)

type Auditer

type Auditer interface {
	LogUserCmd(msg string, result uint)
	LogUserConfig(msg string, result bool)
}

type LogType

type LogType uint

type TestAudit

type TestAudit struct {
	Auditer
	// contains filtered or unexported fields
}

func NewTestAudit

func NewTestAudit() *TestAudit

func (*TestAudit) ClearUserLogs

func (a *TestAudit) ClearUserLogs()

func (*TestAudit) GetUserLogs

func (a *TestAudit) GetUserLogs() UserLogSlice

func (*TestAudit) LogUserCmd

func (a *TestAudit) LogUserCmd(msg string, result uint)

func (*TestAudit) LogUserConfig

func (a *TestAudit) LogUserConfig(msg string, result bool)

type UserLog

type UserLog struct {
	Type   LogType
	Msg    string
	Result uint
}

type UserLogSlice

type UserLogSlice []UserLog

func (UserLogSlice) Len

func (s UserLogSlice) Len() int

func (UserLogSlice) Less

func (s UserLogSlice) Less(i, j int) bool

func (UserLogSlice) Swap

func (s UserLogSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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