Documentation ¶
Index ¶
- Variables
- func New[T ~Message](key Key, attributes, meta any) *T
- func Random[T ~Message]() *T
- func RandomAttributes(attributes any)
- func RandomWithAttributes[T ~Message](attributes any, shouldRandomize bool) *T
- func RandomWithKey[T ~Message](key Key) *T
- type Key
- type KeyComponents
- type Message
- type Recipient
- type RecipientComponents
Constants ¶
This section is empty.
Variables ¶
View Source
var Status = struct { Queued, Succeeded, Failed, Done string }{ Queued: "queued", Succeeded: "succeeded", Failed: "failed", Done: "done", }
View Source
var Type = struct { Event, Command, Query, Response string }{ Event: "event", Command: "command", Query: "query", Response: "response", }
Functions ¶
func RandomAttributes ¶ added in v4.8.0
func RandomAttributes(attributes any)
func RandomWithAttributes ¶ added in v4.8.0
func RandomWithKey ¶ added in v4.8.0
Types ¶
type Key ¶ added in v4.8.0
type Key string
func NewKey ¶ added in v4.8.0
func NewKey(key *KeyComponents) Key
type KeyComponents ¶ added in v4.8.0
type KeyComponents struct {
Organization, Service, Version, Type, Entity, Event, Command, Query, Response, Status string
}
Terminology:
- Organization = Context
- Service = Module
- Entity = Aggregate/Root
Nomenclature of a Key:
- organization.service.version.type.entity.event/command/query/response.status
- codexgo.user.1.event.user.created.succeeded
type Recipient ¶ added in v4.8.0
type Recipient string
func NewRecipient ¶ added in v4.8.0
func NewRecipient(recipient *RecipientComponents) Recipient
type RecipientComponents ¶ added in v4.8.0
type RecipientComponents struct {
Service, Entity, Action, Event, Command, Status string
}
Terminology:
- Service = Module
- Entity = Aggregate/Root
Nomenclature of a Recipient:
- service.entity.action_on_event/command_status
- user.user.send_confirmation_on_created_succeeded
Click to show internal directories.
Click to hide internal directories.