envelopespec

package
v0.0.0-...-eadad3b Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package envelopespec contains the draft Protocol Buffers message specification for the dogma.envelope.v1 namespace.

Index

Constants

This section is empty.

Variables

View Source
var File_draftspecs_envelopespec_envelope_proto protoreflect.FileDescriptor

Functions

func CheckWellFormed

func CheckWellFormed(env *Envelope) error

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

func MarshalTime(t time.Time) string

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

func UnmarshalIdentity(id *Identity) (configkit.Identity, error)

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.

func UnmarshalTime

func UnmarshalTime(t string) (time.Time, error)

UnmarshalTime unmarshals a t from its RFC-3339 representation, as used within envelopes.

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) Descriptor() ([]byte, []int)

Deprecated: Use Envelope.ProtoReflect.Descriptor instead.

func (*Envelope) GetCausationId

func (x *Envelope) GetCausationId() string

func (*Envelope) GetCorrelationId

func (x *Envelope) GetCorrelationId() string

func (*Envelope) GetCreatedAt

func (x *Envelope) GetCreatedAt() string

func (*Envelope) GetData

func (x *Envelope) GetData() []byte

func (*Envelope) GetDescription

func (x *Envelope) GetDescription() string

func (*Envelope) GetMediaType

func (x *Envelope) GetMediaType() string

func (*Envelope) GetMessageId

func (x *Envelope) GetMessageId() string

func (*Envelope) GetPortableName

func (x *Envelope) GetPortableName() string

func (*Envelope) GetScheduledFor

func (x *Envelope) GetScheduledFor() string

func (*Envelope) GetSourceApplication

func (x *Envelope) GetSourceApplication() *Identity

func (*Envelope) GetSourceHandler

func (x *Envelope) GetSourceHandler() *Identity

func (*Envelope) GetSourceInstanceId

func (x *Envelope) GetSourceInstanceId() string

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) ProtoReflect

func (x *Envelope) ProtoReflect() protoreflect.Message

func (*Envelope) Reset

func (x *Envelope) Reset()

func (*Envelope) String

func (x *Envelope) String() string

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

func MarshalIdentity(id configkit.Identity) *Identity

MarshalIdentity marshals id to its protocol buffers representation, as used within message envelopes.

func (*Identity) Descriptor deprecated

func (*Identity) Descriptor() ([]byte, []int)

Deprecated: Use Identity.ProtoReflect.Descriptor instead.

func (*Identity) GetKey

func (x *Identity) GetKey() string

func (*Identity) GetName

func (x *Identity) GetName() string

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) ProtoReflect

func (x *Identity) ProtoReflect() protoreflect.Message

func (*Identity) Reset

func (x *Identity) Reset()

func (*Identity) String

func (x *Identity) String() string

Jump to

Keyboard shortcuts

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