audit

package
v1.262.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayIndexForObjectIndex

func ArrayIndexForObjectIndex(arrayOfObjects []map[string]any, objectIndex int64) int

ArrayIndexForObjectIndex gets the index of arrayOfObjects where the object's index field is equal to objectIndex.

func CheckToFormatForAuditEvent added in v1.236.0

func CheckToFormatForAuditEvent(changes map[string]any, original any, new any, field string, objectKey string, index int) (didInsert bool)

func ChildObjectChanges

func ChildObjectChanges(changes map[string]any, objectPath string, fieldPath string, changeFrom any, changeTo any)

func GetAllChanges

func GetAllChanges(original any, new any) (map[string]any, error)

GetAllChanges Returns the diff, structured in json, recursively Be warned, here be dragons. Debug this first to understand how it works

func GetChanges

func GetChanges(original any, new any) (map[string]any, error)

func GetIntValue

func GetIntValue(object any, key string) int64

func GetStringValue

func GetStringValue(object any, key string) string

func ToSnakeCase

func ToSnakeCase(str string) string

func VerifyAuditEvents added in v1.54.0

func VerifyAuditEvents(original any, new any) error

Types

type FieldChange

type FieldChange struct {
	From any `json:"change_from"`
	To   any `json:"change_to"`
}

type IAuditFormatter added in v1.236.0

type IAuditFormatter interface {
	FormatForAuditEvent() string
}

Jump to

Keyboard shortcuts

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