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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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