Documentation ¶
Overview ¶
Package envelopespec contains the draft Protocol Buffers message specification for the dogma.envelope.v1 namespace.
Index ¶
- Variables
- func CheckWellFormed(env *Envelope) error
- func MarshalMessage(vm marshalkit.ValueMarshaler, m dogma.Message, env *Envelope)
- func MarshalTime(t time.Time) string
- func MustBeWellFormed(env *Envelope)
- func UnmarshalIdentity(id *Identity) (configkit.Identity, error)
- func UnmarshalMessage(vm marshalkit.ValueMarshaler, env *Envelope) (dogma.Message, error)
- func UnmarshalTime(t string) (time.Time, error)
- type Envelope
- func (*Envelope) Descriptor() ([]byte, []int)deprecated
- func (x *Envelope) GetCausationId() string
- func (x *Envelope) GetCorrelationId() string
- func (x *Envelope) GetCreatedAt() string
- func (x *Envelope) GetData() []byte
- func (x *Envelope) GetDescription() string
- func (x *Envelope) GetMediaType() string
- func (x *Envelope) GetMessageId() string
- func (x *Envelope) GetPortableName() string
- func (x *Envelope) GetScheduledFor() string
- func (x *Envelope) GetSourceApplication() *Identity
- func (x *Envelope) GetSourceHandler() *Identity
- func (x *Envelope) GetSourceInstanceId() string
- func (*Envelope) ProtoMessage()
- func (x *Envelope) ProtoReflect() protoreflect.Message
- func (x *Envelope) Reset()
- func (x *Envelope) String() string
- type Identity
Constants ¶
This section is empty.
Variables ¶
var File_draftspecs_envelopespec_envelope_proto protoreflect.FileDescriptor
Functions ¶
func CheckWellFormed ¶
CheckWellFormed returns an error if env is not well-formed.
Well-formedness means that all compulsory fields are populated, and that no incompatible fields are populated.
It is intentially fairly permissive, so that message meta-data can be obtained even if the message is unable to be handled.
It does not perform "deep" validation, such as ensuring messages, times, etc can be unmarshaled.
func MarshalMessage ¶
func MarshalMessage( vm marshalkit.ValueMarshaler, m dogma.Message, env *Envelope, )
MarshalMessage marshals a Dogma message into an envelope.
func MarshalTime ¶
MarshalTime marshals t to its RFC-3339 representation, as used within envelopes.
func MustBeWellFormed ¶
func MustBeWellFormed(env *Envelope)
MustBeWellFormed panics if env is not well-formed.
func UnmarshalIdentity ¶
UnmarshalIdentity unmarshals id from its protocol buffers representation, as used within message envelopes.
func UnmarshalMessage ¶
func UnmarshalMessage( vm marshalkit.ValueMarshaler, env *Envelope, ) (dogma.Message, error)
UnmarshalMessage unmarshals a Dogma message from an envelope.
Types ¶
type Envelope ¶
type Envelope struct { // MessageId is a unique identifier for the message. MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` // CausationId is the ID of the message that was the direct cause of the // message in this envelope. CausationId string `protobuf:"bytes,2,opt,name=causation_id,json=causationId,proto3" json:"causation_id,omitempty"` // CorrelationId is the ID of the first ancestor of the message in this // envelope that was not caused by another message. CorrelationId string `protobuf:"bytes,3,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"` // SourceApplication is the identity of the Dogma application that produced // the message in this envelope. SourceApplication *Identity `protobuf:"bytes,4,opt,name=source_application,json=sourceApplication,proto3" json:"source_application,omitempty"` // SourceHandler is the identity of the Dogma handler that produced the // message in this envelope. It is the zero-value if the message was not // produced by a handler. SourceHandler *Identity `protobuf:"bytes,5,opt,name=source_handler,json=sourceHandler,proto3" json:"source_handler,omitempty"` // SourceInstanceId is the ID of the aggregate or process instance that // produced the message in this envelope. It is empty if the message was not // produced by a handler, or it was produced by an integration handler. SourceInstanceId string `protobuf:"bytes,6,opt,name=source_instance_id,json=sourceInstanceId,proto3" json:"source_instance_id,omitempty"` // CreatedAt is the time at which the message was created, marshaled in // RFC-3339 format, with nanoseconds. CreatedAt string `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // ScheduledFor is the time at which a timeout message was scheduled, RFC-3339 // format, with nanoseconds. ScheduledFor string `protobuf:"bytes,8,opt,name=scheduled_for,json=scheduledFor,proto3" json:"scheduled_for,omitempty"` // Description is a human-readable description of the message. Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"` // PortableName is the unique name used to identify messages of this type. PortableName string `protobuf:"bytes,10,opt,name=portable_name,json=portableName,proto3" json:"portable_name,omitempty"` // MediaType is a MIME media-type describing the content and encoding of the // binary message data. MediaType string `protobuf:"bytes,11,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` // Data is the binary message data. Data []byte `protobuf:"bytes,12,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
Envelope is a container for a marshaled message and it meta-data.
func (*Envelope) Descriptor
deprecated
func (*Envelope) GetCausationId ¶
func (*Envelope) GetCorrelationId ¶
func (*Envelope) GetCreatedAt ¶
func (*Envelope) GetDescription ¶
func (*Envelope) GetMediaType ¶
func (*Envelope) GetMessageId ¶
func (*Envelope) GetPortableName ¶
func (*Envelope) GetScheduledFor ¶
func (*Envelope) GetSourceApplication ¶
func (*Envelope) GetSourceHandler ¶
func (*Envelope) GetSourceInstanceId ¶
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
func (*Envelope) ProtoReflect ¶
func (x *Envelope) ProtoReflect() protoreflect.Message
type Identity ¶
type Identity struct { // Name is the entity's unique name. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Key is the entity's immutable, unique key. Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
Identity is the identity of a Dogma application or handler.
func MarshalIdentity ¶
MarshalIdentity marshals id to its protocol buffers representation, as used within message envelopes.
func (*Identity) Descriptor
deprecated
func (*Identity) ProtoMessage ¶
func (*Identity) ProtoMessage()
func (*Identity) ProtoReflect ¶
func (x *Identity) ProtoReflect() protoreflect.Message