audit

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 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     uuid.NullUUID
	TargetType  string
	TargetID    uuid.NullUUID
	PrevPayload json.RawMessage
	Payload     json.RawMessage
}

func NewBasicEvent

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

func NewBasicEventWithTarget added in v0.24.0

func NewBasicEventWithTarget(event string, target Target, actorType string, 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

func WithTargetID added in v0.24.0

func WithTargetID(id uuid.UUID) EventOption

type Target

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

Jump to

Keyboard shortcuts

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