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