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 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
Click to show internal directories.
Click to hide internal directories.