audit

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TryMarshall

func TryMarshall(v interface{}) []byte

TryMarshall attempts to marshal the given object into a JSON string. If the object cannot be marshalled, nil is returned.

Types

type ActorType

type ActorType string

type BasicEvent

type BasicEvent struct {
	EventType   Type
	TargetType  TargetType
	TargetID    uuid.UUID
	ActorType   ActorType
	ActorID     uuid.NullUUID
	PrevPayload json.RawMessage
	Payload     json.RawMessage
}

func NewBasicEvent

func NewBasicEvent(event Type, target Target, actor ActorType, opts ...EventOption) *BasicEvent

type EventOption

type EventOption interface {
	Apply(*BasicEvent)
}

func WithActorID

func WithActorID(id uuid.UUID) EventOption

func WithPayload

func WithPayload(v interface{}) EventOption

func WithPrevPayload

func WithPrevPayload(v interface{}) EventOption

type Target

type Target interface {
	GetID() uuid.UUID
	GetAuditTargetType() TargetType
}

type TargetType

type TargetType string

type Type

type Type string

Jump to

Keyboard shortcuts

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