Help us shape the future of Go! Take the 2026 Go Developer Survey

audit

package
v0.58.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActorTypeServer  = "SERVER"
	ActorTypeUser    = "USER"
	ActorTypeMember  = "MEMBER"
	ActorTypeWebhook = "WEBHOOK"
)

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 BasicEvent

type BasicEvent struct {
	EventType   string
	ActorType   string
	ActorID     *string
	TargetType  string
	TargetID    *string
	PrevPayload json.RawMessage
	Payload     json.RawMessage
}

func NewBasicEvent

func NewBasicEvent(event string, targetType string, actorType string, opts ...EventOption) *BasicEvent

func NewBasicEventWithUUIDTarget added in v0.51.0

func NewBasicEventWithUUIDTarget(event string, target UUIDTarget, actorType string, opts ...EventOption) *BasicEvent

type EventOption

type EventOption interface {
	Apply(*BasicEvent)
}

func WithActorID

func WithActorID(id string) EventOption

func WithPayload

func WithPayload(v interface{}) EventOption

func WithPrevPayload

func WithPrevPayload(v interface{}) EventOption

func WithTargetID added in v0.24.0

func WithTargetID(id string) EventOption

type UUIDTarget added in v0.51.0

type UUIDTarget interface {
	GetID() uuid.UUID
	GetAuditTargetType() string
}

Jump to

Keyboard shortcuts

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