Documentation
¶
Overview ¶
Package envelopepb provides the "well-known" Envelope type for representing message envelopes as Protocol Buffers messages.
Index ¶
- Variables
- func GetBaggage[T interface{ ... }, E any](env *Envelope) (T, bool, error)
- func GetExtension[T interface{ ... }, E any](env *Envelope) (T, bool, error)
- func MustGetBaggage[T interface{ ... }, E any](env *Envelope) T
- func MustGetExtension[T interface{ ... }, E any](env *Envelope) T
- func SetBaggage[T interface{ ... }, E any](body *Body, x T)
- func SetExtension[T interface{ ... }, E any](body *Body, x T)
- func Unpack[T dogma.Message](env *Envelope) (T, error)
- func WithBaggage(x proto.Message) interface{ ... }
- func WithExtension(x proto.Message) interface{ ... }
- type Body
- func (x *Body) ClearCreatedAt()
- func (x *Body) ClearMessage()
- func (x *Body) ClearMessageId()
- func (x *Body) ClearScheduledFor()
- func (x *Body) Format(f fmt.State, verb rune)
- func (x *Body) GetBaggage() []*anypb.Any
- func (x *Body) GetCreatedAt() *timestamppb.Timestamp
- func (x *Body) GetExtensions() []*anypb.Any
- func (x *Body) GetIdempotencyKey() string
- func (x *Body) GetMessage() *Message
- func (x *Body) GetMessageId() *uuidpb.UUID
- func (x *Body) GetScheduledFor() *timestamppb.Timestamp
- func (x *Body) HasCreatedAt() bool
- func (x *Body) HasMessage() bool
- func (x *Body) HasMessageId() bool
- func (x *Body) HasScheduledFor() bool
- func (x *Body) MarshalBinary() ([]byte, error)
- func (*Body) ProtoMessage()
- func (x *Body) ProtoReflect() protoreflect.Message
- func (x *Body) Reset()
- func (x *Body) SetBaggage(v []*anypb.Any)
- func (x *Body) SetCreatedAt(v *timestamppb.Timestamp)
- func (x *Body) SetExtensions(v []*anypb.Any)
- func (x *Body) SetIdempotencyKey(v string)
- func (x *Body) SetMessage(v *Message)
- func (x *Body) SetMessageId(v *uuidpb.UUID)
- func (x *Body) SetScheduledFor(v *timestamppb.Timestamp)
- func (x *Body) String() string
- func (x *Body) UnmarshalBinary(data []byte) error
- type BodyBuilder
- func (b *BodyBuilder) Build() *Body
- func (b *BodyBuilder) From(x *Body) *BodyBuilder
- func (b *BodyBuilder) WithBaggage(v []*anypb.Any) *BodyBuilder
- func (b *BodyBuilder) WithCreatedAt(v *timestamppb.Timestamp) *BodyBuilder
- func (b *BodyBuilder) WithExtensions(v []*anypb.Any) *BodyBuilder
- func (b *BodyBuilder) WithIdempotencyKey(v string) *BodyBuilder
- func (b *BodyBuilder) WithMessage(v *Message) *BodyBuilder
- func (b *BodyBuilder) WithMessageId(v *uuidpb.UUID) *BodyBuilder
- func (b *BodyBuilder) WithScheduledFor(v *timestamppb.Timestamp) *BodyBuilder
- type Body_builder
- type EffectPacker
- func (p *EffectPacker) PackCommand(m dogma.Command, options ...PackEffectCommandOption) *Envelope
- func (p *EffectPacker) PackDeadline(m dogma.Deadline, options ...PackEffectDeadlineOption) *Envelope
- func (p *EffectPacker) PackEvent(m dogma.Event, options ...PackEffectEventOption) *Envelope
- func (p *EffectPacker) Seal() (*MultiEnvelope, bool)
- type Envelope
- func (x *Envelope) AsMultiEnvelope() *MultiEnvelope
- func (x *Envelope) ClearBody()
- func (x *Envelope) ClearHeader()
- func (x *Envelope) Format(f fmt.State, verb rune)
- func (x *Envelope) GetBody() *Body
- func (x *Envelope) GetHeader() *Header
- func (x *Envelope) HasBody() bool
- func (x *Envelope) HasHeader() bool
- func (x *Envelope) MarshalBinary() ([]byte, error)
- func (*Envelope) ProtoMessage()
- func (x *Envelope) ProtoReflect() protoreflect.Message
- func (x *Envelope) Reset()
- func (x *Envelope) SetBody(v *Body)
- func (x *Envelope) SetHeader(v *Header)
- func (x *Envelope) String() string
- func (x *Envelope) UnmarshalBinary(data []byte) error
- func (x *Envelope) Validate() error
- type EnvelopeBuilder
- type Envelope_builder
- type EventStreamPosition
- func (x *EventStreamPosition) ClearStreamId()
- func (x *EventStreamPosition) Format(f fmt.State, verb rune)
- func (x *EventStreamPosition) GetOffset() uint64
- func (x *EventStreamPosition) GetStreamId() *uuidpb.UUID
- func (x *EventStreamPosition) HasStreamId() bool
- func (x *EventStreamPosition) MarshalBinary() ([]byte, error)
- func (*EventStreamPosition) ProtoMessage()
- func (x *EventStreamPosition) ProtoReflect() protoreflect.Message
- func (x *EventStreamPosition) Reset()
- func (x *EventStreamPosition) SetOffset(v uint64)
- func (x *EventStreamPosition) SetStreamId(v *uuidpb.UUID)
- func (x *EventStreamPosition) String() string
- func (x *EventStreamPosition) UnmarshalBinary(data []byte) error
- type EventStreamPositionBuilder
- func (b *EventStreamPositionBuilder) Build() *EventStreamPosition
- func (b *EventStreamPositionBuilder) From(x *EventStreamPosition) *EventStreamPositionBuilder
- func (b *EventStreamPositionBuilder) WithOffset(v uint64) *EventStreamPositionBuilder
- func (b *EventStreamPositionBuilder) WithStreamId(v *uuidpb.UUID) *EventStreamPositionBuilder
- type EventStreamPosition_builder
- type Header
- func (x *Header) ClearCausationId()
- func (x *Header) ClearCorrelationId()
- func (x *Header) ClearSource()
- func (x *Header) Format(f fmt.State, verb rune)
- func (x *Header) GetBaggage() []*anypb.Any
- func (x *Header) GetCausationId() *uuidpb.UUID
- func (x *Header) GetCorrelationId() *uuidpb.UUID
- func (x *Header) GetExtensions() []*anypb.Any
- func (x *Header) GetSource() *Source
- func (x *Header) HasCausationId() bool
- func (x *Header) HasCorrelationId() bool
- func (x *Header) HasSource() bool
- func (x *Header) MarshalBinary() ([]byte, error)
- func (*Header) ProtoMessage()
- func (x *Header) ProtoReflect() protoreflect.Message
- func (x *Header) Reset()
- func (x *Header) SetBaggage(v []*anypb.Any)
- func (x *Header) SetCausationId(v *uuidpb.UUID)
- func (x *Header) SetCorrelationId(v *uuidpb.UUID)
- func (x *Header) SetExtensions(v []*anypb.Any)
- func (x *Header) SetSource(v *Source)
- func (x *Header) String() string
- func (x *Header) UnmarshalBinary(data []byte) error
- type HeaderBuilder
- func (b *HeaderBuilder) Build() *Header
- func (b *HeaderBuilder) From(x *Header) *HeaderBuilder
- func (b *HeaderBuilder) WithBaggage(v []*anypb.Any) *HeaderBuilder
- func (b *HeaderBuilder) WithCausationId(v *uuidpb.UUID) *HeaderBuilder
- func (b *HeaderBuilder) WithCorrelationId(v *uuidpb.UUID) *HeaderBuilder
- func (b *HeaderBuilder) WithExtensions(v []*anypb.Any) *HeaderBuilder
- func (b *HeaderBuilder) WithSource(v *Source) *HeaderBuilder
- type Header_builder
- type Message
- func (x *Message) ClearTypeId()
- func (x *Message) Format(f fmt.State, verb rune)
- func (x *Message) GetData() []byte
- func (x *Message) GetDescription() string
- func (x *Message) GetTypeId() *uuidpb.UUID
- func (x *Message) HasTypeId() bool
- func (x *Message) MarshalBinary() ([]byte, error)
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) SetData(v []byte)
- func (x *Message) SetDescription(v string)
- func (x *Message) SetTypeId(v *uuidpb.UUID)
- func (x *Message) String() string
- func (x *Message) UnmarshalBinary(data []byte) error
- type MessageBuilder
- type Message_builder
- type MultiEnvelope
- func (x *MultiEnvelope) All() iter.Seq[*Envelope]
- func (x *MultiEnvelope) AppendBodies(bodies ...*Body)
- func (x *MultiEnvelope) ClearHeader()
- func (x *MultiEnvelope) Format(f fmt.State, verb rune)
- func (x *MultiEnvelope) GetBodies() []*Body
- func (x *MultiEnvelope) GetHeader() *Header
- func (x *MultiEnvelope) HasHeader() bool
- func (x *MultiEnvelope) MarshalBinary() ([]byte, error)
- func (*MultiEnvelope) ProtoMessage()
- func (x *MultiEnvelope) ProtoReflect() protoreflect.Message
- func (x *MultiEnvelope) Reset()
- func (x *MultiEnvelope) SetBodies(v []*Body)
- func (x *MultiEnvelope) SetHeader(v *Header)
- func (x *MultiEnvelope) String() string
- func (x *MultiEnvelope) TryAppendEnvelope(env *Envelope) bool
- func (x *MultiEnvelope) UnmarshalBinary(data []byte) error
- func (x *MultiEnvelope) Validate() error
- type MultiEnvelopeBuilder
- type MultiEnvelope_builder
- type PackCommandOption
- type PackEffectCommandOption
- type PackEffectDeadlineOption
- type PackEffectEventOption
- type PackEffectsOption
- type Packer
- type Source
- func (x *Source) ClearApplication()
- func (x *Source) ClearHandler()
- func (x *Source) ClearSite()
- func (x *Source) Format(f fmt.State, verb rune)
- func (x *Source) GetApplication() *identitypb.Identity
- func (x *Source) GetHandler() *identitypb.Identity
- func (x *Source) GetInstanceId() string
- func (x *Source) GetSite() *identitypb.Identity
- func (x *Source) HasApplication() bool
- func (x *Source) HasHandler() bool
- func (x *Source) HasSite() bool
- func (x *Source) MarshalBinary() ([]byte, error)
- func (*Source) ProtoMessage()
- func (x *Source) ProtoReflect() protoreflect.Message
- func (x *Source) Reset()
- func (x *Source) SetApplication(v *identitypb.Identity)
- func (x *Source) SetHandler(v *identitypb.Identity)
- func (x *Source) SetInstanceId(v string)
- func (x *Source) SetSite(v *identitypb.Identity)
- func (x *Source) String() string
- func (x *Source) UnmarshalBinary(data []byte) error
- type SourceBuilder
- func (b *SourceBuilder) Build() *Source
- func (b *SourceBuilder) From(x *Source) *SourceBuilder
- func (b *SourceBuilder) WithApplication(v *identitypb.Identity) *SourceBuilder
- func (b *SourceBuilder) WithHandler(v *identitypb.Identity) *SourceBuilder
- func (b *SourceBuilder) WithInstanceId(v string) *SourceBuilder
- func (b *SourceBuilder) WithSite(v *identitypb.Identity) *SourceBuilder
- type Source_builder
Constants ¶
This section is empty.
Variables ¶
var File_github_com_dogmatiq_enginekit_protobuf_envelopepb_envelope_proto protoreflect.FileDescriptor
var File_github_com_dogmatiq_enginekit_protobuf_envelopepb_extensions_proto protoreflect.FileDescriptor
Functions ¶
func GetBaggage ¶ added in v0.26.4
GetBaggage returns the baggage value matching T from env's baggage.
Values in the envelope's body take precedence over those in its header.
The second return value reports whether a baggage value of the matching type was present. The third return value is non-nil if the baggage value was present but could not be unmarshalled.
func GetExtension ¶ added in v0.26.4
GetExtension returns the extension matching T from env's extensions.
Values in the envelope's body take precedence over those in its header.
The second return value reports whether an extension of the matching type was present. The third return value is non-nil if the extension was present but could not be unmarshalled.
func MustGetBaggage ¶ added in v0.27.7
MustGetBaggage returns the baggage value matching T from env's baggage.
It panics if no baggage value of the matching type is present, or if it could not be unmarshalled.
func MustGetExtension ¶ added in v0.27.7
MustGetExtension returns the extension matching T from env's extensions.
It panics if no extension of the matching type is present, or if it could not be unmarshalled.
func SetBaggage ¶ added in v0.26.4
SetBaggage sets x as a baggage value on body. If a baggage value with the same type URL is already present, it is replaced.
It panics if x is nil.
func SetExtension ¶ added in v0.26.4
SetExtension sets x as an extension on body. If an extension with the same type URL is already present, it is replaced.
It panics if x is nil.
func Unpack ¶ added in v0.19.0
Unpack returns the message contained within an envelope.
T may be a message interface such as dogma.Command or a concrete message type.
func WithBaggage ¶ added in v0.22.0
func WithBaggage(x proto.Message) interface { PackCommandOption PackEffectsOption PackEffectCommandOption PackEffectEventOption PackEffectDeadlineOption }
WithBaggage adds x to the envelope's baggage.
Baggage applies to the envelope being packed and is inherited by downstream messages in the causal chain.
func WithExtension ¶ added in v0.22.0
func WithExtension(x proto.Message) interface { PackCommandOption PackEffectsOption PackEffectCommandOption PackEffectEventOption PackEffectDeadlineOption }
WithExtension adds x to the envelope's extensions.
Extensions apply only to the envelope being packed; they are not inherited by downstream messages in the causal chain.
Types ¶
type Body ¶ added in v0.21.0
type Body struct {
// contains filtered or unexported fields
}
Body contains the metadata and encoded form of a single message in an Envelope or MultiEnvelope.
func (*Body) ClearCreatedAt ¶ added in v0.23.0
func (x *Body) ClearCreatedAt()
func (*Body) ClearMessage ¶ added in v0.23.0
func (x *Body) ClearMessage()
func (*Body) ClearMessageId ¶ added in v0.23.0
func (x *Body) ClearMessageId()
func (*Body) ClearScheduledFor ¶ added in v0.23.0
func (x *Body) ClearScheduledFor()
func (*Body) Format ¶ added in v0.27.0
Format formats x according to the given fmt verb.
It implements fmt.Formatter, taking precedence over the String() method generated by the Protocol Buffers compiler.
For the %s and %q verbs it uses the string returned by x.AsString() if x provides such a method. For the %#v verb it uses the string returned by x.GoString() if x provides such a method. Otherwise it formats x as though this method were not defined.
AsString() and GoString() are called even when x is nil, since some message types handle a nil receiver themselves. If either method panics, the panic is formatted the same way the fmt package formats a panicking String() method.
func (*Body) GetBaggage ¶ added in v0.22.0
func (*Body) GetCreatedAt ¶ added in v0.21.0
func (x *Body) GetCreatedAt() *timestamppb.Timestamp
func (*Body) GetExtensions ¶ added in v0.21.0
func (*Body) GetIdempotencyKey ¶ added in v0.21.0
func (*Body) GetMessage ¶ added in v0.21.0
func (*Body) GetMessageId ¶ added in v0.21.0
func (*Body) GetScheduledFor ¶ added in v0.21.0
func (x *Body) GetScheduledFor() *timestamppb.Timestamp
func (*Body) HasCreatedAt ¶ added in v0.23.0
func (*Body) HasMessage ¶ added in v0.23.0
func (*Body) HasMessageId ¶ added in v0.23.0
func (*Body) HasScheduledFor ¶ added in v0.23.0
func (*Body) MarshalBinary ¶ added in v0.21.0
MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).
It allows *Body to implement encoding.BinaryMarshaler.
func (*Body) ProtoMessage ¶ added in v0.21.0
func (*Body) ProtoMessage()
func (*Body) ProtoReflect ¶ added in v0.21.0
func (x *Body) ProtoReflect() protoreflect.Message
func (*Body) SetBaggage ¶ added in v0.22.0
func (*Body) SetCreatedAt ¶ added in v0.21.0
func (x *Body) SetCreatedAt(v *timestamppb.Timestamp)
func (*Body) SetExtensions ¶ added in v0.21.0
func (*Body) SetIdempotencyKey ¶ added in v0.21.0
func (*Body) SetMessage ¶ added in v0.21.0
func (*Body) SetMessageId ¶ added in v0.21.0
func (*Body) SetScheduledFor ¶ added in v0.21.0
func (x *Body) SetScheduledFor(v *timestamppb.Timestamp)
func (*Body) UnmarshalBinary ¶ added in v0.21.0
UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).
It allows *Body to implement encoding.BinaryUnmarshaler.
type BodyBuilder ¶ added in v0.21.0
type BodyBuilder struct {
// contains filtered or unexported fields
}
func NewBodyBuilder ¶ added in v0.21.0
func NewBodyBuilder() *BodyBuilder
NewBodyBuilder returns a builder that constructs Body messages.
func (*BodyBuilder) Build ¶ added in v0.21.0
func (b *BodyBuilder) Build() *Body
Build returns a new Body containing the values configured via the builder.
Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.
func (*BodyBuilder) From ¶ added in v0.21.0
func (b *BodyBuilder) From(x *Body) *BodyBuilder
From configures the builder to use x as the prototype for new messages, then returns b.
It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.
func (*BodyBuilder) WithBaggage ¶ added in v0.22.0
func (b *BodyBuilder) WithBaggage(v []*anypb.Any) *BodyBuilder
WithBaggage configures the builder to set the Baggage field to v, then returns b.
func (*BodyBuilder) WithCreatedAt ¶ added in v0.21.0
func (b *BodyBuilder) WithCreatedAt(v *timestamppb.Timestamp) *BodyBuilder
WithCreatedAt configures the builder to set the CreatedAt field to v, then returns b.
func (*BodyBuilder) WithExtensions ¶ added in v0.21.0
func (b *BodyBuilder) WithExtensions(v []*anypb.Any) *BodyBuilder
WithExtensions configures the builder to set the Extensions field to v, then returns b.
func (*BodyBuilder) WithIdempotencyKey ¶ added in v0.21.0
func (b *BodyBuilder) WithIdempotencyKey(v string) *BodyBuilder
WithIdempotencyKey configures the builder to set the IdempotencyKey field to v, then returns b.
func (*BodyBuilder) WithMessage ¶ added in v0.21.0
func (b *BodyBuilder) WithMessage(v *Message) *BodyBuilder
WithMessage configures the builder to set the Message field to v, then returns b.
func (*BodyBuilder) WithMessageId ¶ added in v0.21.0
func (b *BodyBuilder) WithMessageId(v *uuidpb.UUID) *BodyBuilder
WithMessageId configures the builder to set the MessageId field to v, then returns b.
func (*BodyBuilder) WithScheduledFor ¶ added in v0.21.0
func (b *BodyBuilder) WithScheduledFor(v *timestamppb.Timestamp) *BodyBuilder
WithScheduledFor configures the builder to set the ScheduledFor field to v, then returns b.
type Body_builder ¶ added in v0.23.0
type Body_builder struct {
// MessageId is a unique identifier for the message in this envelope.
MessageId *uuidpb.UUID
// IdempotencyKey is an application-defined value used to identify a command
// across retries.
//
// It is the zero-value if the message is not a command, or if the producer
// of the message did not provide an idempotency key.
IdempotencyKey string
// CreatedAt is the time at which the envelope was created.
//
// This is typically the point at which the message first enters the engine.
CreatedAt *timestamppb.Timestamp
// ScheduledFor is the time at which a deadline is reached.
//
// It is the zero-value if the message is a command or event.
ScheduledFor *timestamppb.Timestamp
// Message is the encoded representation of the [dogma.Message].
Message *Message
// Extensions is a set of extension values associated with this message.
//
// Any values in [Header.Extensions] are overridden by values in this field
// that have the same type URL.
Extensions []*anypb.Any
// Baggage is a set of extension values associated with this message and/or
// its causal chain.
//
// Any values in [Header.Baggage] are overridden by values in this field
// that have the same type URL.
Baggage []*anypb.Any
// contains filtered or unexported fields
}
func (Body_builder) Build ¶ added in v0.23.0
func (b0 Body_builder) Build() *Body
type EffectPacker ¶ added in v0.22.0
type EffectPacker struct {
// contains filtered or unexported fields
}
An EffectPacker packs messages produced while handling a specific causal message into a MultiEnvelope.
func (*EffectPacker) PackCommand ¶ added in v0.22.0
func (p *EffectPacker) PackCommand(m dogma.Command, options ...PackEffectCommandOption) *Envelope
PackCommand appends m to the multi-envelope under construction.
func (*EffectPacker) PackDeadline ¶ added in v0.26.0
func (p *EffectPacker) PackDeadline(m dogma.Deadline, options ...PackEffectDeadlineOption) *Envelope
PackDeadline appends m to the multi-envelope under construction.
func (*EffectPacker) PackEvent ¶ added in v0.22.0
func (p *EffectPacker) PackEvent(m dogma.Event, options ...PackEffectEventOption) *Envelope
PackEvent appends m to the multi-envelope under construction.
func (*EffectPacker) Seal ¶ added in v0.22.0
func (p *EffectPacker) Seal() (*MultiEnvelope, bool)
Seal returns a MultiEnvelope containing all packed messages, or false if no messages were packed.
type Envelope ¶
type Envelope struct {
// contains filtered or unexported fields
}
Envelope is a container for a Dogma message and its meta-data.
It is wire-compatible with MultiEnvelope.
func (*Envelope) AsMultiEnvelope ¶ added in v0.27.0
func (x *Envelope) AsMultiEnvelope() *MultiEnvelope
AsMultiEnvelope returns a MultiEnvelope that contains the same header and body as x.
This is a convenience method for when you want to treat a single-envelope message as a multi-envelope message.
func (*Envelope) ClearHeader ¶ added in v0.23.0
func (x *Envelope) ClearHeader()
func (*Envelope) Format ¶ added in v0.27.0
Format formats x according to the given fmt verb.
It implements fmt.Formatter, taking precedence over the String() method generated by the Protocol Buffers compiler.
For the %s and %q verbs it uses the string returned by x.AsString() if x provides such a method. For the %#v verb it uses the string returned by x.GoString() if x provides such a method. Otherwise it formats x as though this method were not defined.
AsString() and GoString() are called even when x is nil, since some message types handle a nil receiver themselves. If either method panics, the panic is formatted the same way the fmt package formats a panicking String() method.
func (*Envelope) MarshalBinary ¶ added in v0.18.0
MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).
It allows *Envelope to implement encoding.BinaryMarshaler.
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
func (*Envelope) ProtoReflect ¶
func (x *Envelope) ProtoReflect() protoreflect.Message
func (*Envelope) UnmarshalBinary ¶ added in v0.18.0
UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).
It allows *Envelope to implement encoding.BinaryUnmarshaler.
func (*Envelope) Validate ¶
Validate returns an error if x is not well-formed.
Well-formedness means that all compulsory fields are populated and that no incompatible fields are populated.
It is intentionally 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.
type EnvelopeBuilder ¶
type EnvelopeBuilder struct {
// contains filtered or unexported fields
}
func NewEnvelopeBuilder ¶
func NewEnvelopeBuilder() *EnvelopeBuilder
NewEnvelopeBuilder returns a builder that constructs Envelope messages.
func (*EnvelopeBuilder) Build ¶
func (b *EnvelopeBuilder) Build() *Envelope
Build returns a new Envelope containing the values configured via the builder.
Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.
func (*EnvelopeBuilder) From ¶
func (b *EnvelopeBuilder) From(x *Envelope) *EnvelopeBuilder
From configures the builder to use x as the prototype for new messages, then returns b.
It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.
func (*EnvelopeBuilder) WithBody ¶ added in v0.21.0
func (b *EnvelopeBuilder) WithBody(v *Body) *EnvelopeBuilder
WithBody configures the builder to set the Body field to v, then returns b.
func (*EnvelopeBuilder) WithHeader ¶ added in v0.21.0
func (b *EnvelopeBuilder) WithHeader(v *Header) *EnvelopeBuilder
WithHeader configures the builder to set the Header field to v, then returns b.
type Envelope_builder ¶ added in v0.23.0
type Envelope_builder struct {
Header *Header
Body *Body
// contains filtered or unexported fields
}
func (Envelope_builder) Build ¶ added in v0.23.0
func (b0 Envelope_builder) Build() *Envelope
type EventStreamPosition ¶ added in v0.26.4
type EventStreamPosition struct {
// contains filtered or unexported fields
}
EventStreamPosition is an extension value for an Envelope that identifies the stream from which an event was obtained, and the offset of the event within that stream.
func (*EventStreamPosition) ClearStreamId ¶ added in v0.26.4
func (x *EventStreamPosition) ClearStreamId()
func (*EventStreamPosition) Format ¶ added in v0.27.0
func (x *EventStreamPosition) Format(f fmt.State, verb rune)
Format formats x according to the given fmt verb.
It implements fmt.Formatter, taking precedence over the String() method generated by the Protocol Buffers compiler.
For the %s and %q verbs it uses the string returned by x.AsString() if x provides such a method. For the %#v verb it uses the string returned by x.GoString() if x provides such a method. Otherwise it formats x as though this method were not defined.
AsString() and GoString() are called even when x is nil, since some message types handle a nil receiver themselves. If either method panics, the panic is formatted the same way the fmt package formats a panicking String() method.
func (*EventStreamPosition) GetOffset ¶ added in v0.26.4
func (x *EventStreamPosition) GetOffset() uint64
func (*EventStreamPosition) GetStreamId ¶ added in v0.26.4
func (x *EventStreamPosition) GetStreamId() *uuidpb.UUID
func (*EventStreamPosition) HasStreamId ¶ added in v0.26.4
func (x *EventStreamPosition) HasStreamId() bool
func (*EventStreamPosition) MarshalBinary ¶ added in v0.26.4
func (x *EventStreamPosition) MarshalBinary() ([]byte, error)
MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).
It allows *EventStreamPosition to implement encoding.BinaryMarshaler.
func (*EventStreamPosition) ProtoMessage ¶ added in v0.26.4
func (*EventStreamPosition) ProtoMessage()
func (*EventStreamPosition) ProtoReflect ¶ added in v0.26.4
func (x *EventStreamPosition) ProtoReflect() protoreflect.Message
func (*EventStreamPosition) Reset ¶ added in v0.26.4
func (x *EventStreamPosition) Reset()
func (*EventStreamPosition) SetOffset ¶ added in v0.26.4
func (x *EventStreamPosition) SetOffset(v uint64)
func (*EventStreamPosition) SetStreamId ¶ added in v0.26.4
func (x *EventStreamPosition) SetStreamId(v *uuidpb.UUID)
func (*EventStreamPosition) String ¶ added in v0.26.4
func (x *EventStreamPosition) String() string
func (*EventStreamPosition) UnmarshalBinary ¶ added in v0.26.4
func (x *EventStreamPosition) UnmarshalBinary(data []byte) error
UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).
It allows *EventStreamPosition to implement encoding.BinaryUnmarshaler.
type EventStreamPositionBuilder ¶ added in v0.26.4
type EventStreamPositionBuilder struct {
// contains filtered or unexported fields
}
func NewEventStreamPositionBuilder ¶ added in v0.26.4
func NewEventStreamPositionBuilder() *EventStreamPositionBuilder
NewEventStreamPositionBuilder returns a builder that constructs EventStreamPosition messages.
func (*EventStreamPositionBuilder) Build ¶ added in v0.26.4
func (b *EventStreamPositionBuilder) Build() *EventStreamPosition
Build returns a new EventStreamPosition containing the values configured via the builder.
Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.
func (*EventStreamPositionBuilder) From ¶ added in v0.26.4
func (b *EventStreamPositionBuilder) From(x *EventStreamPosition) *EventStreamPositionBuilder
From configures the builder to use x as the prototype for new messages, then returns b.
It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.
func (*EventStreamPositionBuilder) WithOffset ¶ added in v0.26.4
func (b *EventStreamPositionBuilder) WithOffset(v uint64) *EventStreamPositionBuilder
WithOffset configures the builder to set the Offset field to v, then returns b.
func (*EventStreamPositionBuilder) WithStreamId ¶ added in v0.26.4
func (b *EventStreamPositionBuilder) WithStreamId(v *uuidpb.UUID) *EventStreamPositionBuilder
WithStreamId configures the builder to set the StreamId field to v, then returns b.
type EventStreamPosition_builder ¶ added in v0.26.4
type EventStreamPosition_builder struct {
// StreamId is the identifier of the stream within which the event was
// recorded.
StreamId *uuidpb.UUID
// Offset is the position of the event within the stream. The first event is
// at offset zero.
Offset uint64
// contains filtered or unexported fields
}
func (EventStreamPosition_builder) Build ¶ added in v0.26.4
func (b0 EventStreamPosition_builder) Build() *EventStreamPosition
type Header ¶ added in v0.21.0
type Header struct {
// contains filtered or unexported fields
}
func (*Header) ClearCausationId ¶ added in v0.23.0
func (x *Header) ClearCausationId()
func (*Header) ClearCorrelationId ¶ added in v0.23.0
func (x *Header) ClearCorrelationId()
func (*Header) ClearSource ¶ added in v0.23.0
func (x *Header) ClearSource()
func (*Header) Format ¶ added in v0.27.0
Format formats x according to the given fmt verb.
It implements fmt.Formatter, taking precedence over the String() method generated by the Protocol Buffers compiler.
For the %s and %q verbs it uses the string returned by x.AsString() if x provides such a method. For the %#v verb it uses the string returned by x.GoString() if x provides such a method. Otherwise it formats x as though this method were not defined.
AsString() and GoString() are called even when x is nil, since some message types handle a nil receiver themselves. If either method panics, the panic is formatted the same way the fmt package formats a panicking String() method.
func (*Header) GetBaggage ¶ added in v0.22.0
func (*Header) GetCausationId ¶ added in v0.21.0
func (*Header) GetCorrelationId ¶ added in v0.21.0
func (*Header) GetExtensions ¶ added in v0.21.0
func (*Header) HasCausationId ¶ added in v0.23.0
func (*Header) HasCorrelationId ¶ added in v0.23.0
func (*Header) MarshalBinary ¶ added in v0.21.0
MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).
It allows *Header to implement encoding.BinaryMarshaler.
func (*Header) ProtoMessage ¶ added in v0.21.0
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶ added in v0.21.0
func (x *Header) ProtoReflect() protoreflect.Message
func (*Header) SetBaggage ¶ added in v0.22.0
func (*Header) SetCausationId ¶ added in v0.21.0
func (*Header) SetCorrelationId ¶ added in v0.21.0
func (*Header) SetExtensions ¶ added in v0.21.0
func (*Header) UnmarshalBinary ¶ added in v0.21.0
UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).
It allows *Header to implement encoding.BinaryUnmarshaler.
type HeaderBuilder ¶ added in v0.21.0
type HeaderBuilder struct {
// contains filtered or unexported fields
}
func NewHeaderBuilder ¶ added in v0.21.0
func NewHeaderBuilder() *HeaderBuilder
NewHeaderBuilder returns a builder that constructs Header messages.
func (*HeaderBuilder) Build ¶ added in v0.21.0
func (b *HeaderBuilder) Build() *Header
Build returns a new Header containing the values configured via the builder.
Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.
func (*HeaderBuilder) From ¶ added in v0.21.0
func (b *HeaderBuilder) From(x *Header) *HeaderBuilder
From configures the builder to use x as the prototype for new messages, then returns b.
It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.
func (*HeaderBuilder) WithBaggage ¶ added in v0.22.0
func (b *HeaderBuilder) WithBaggage(v []*anypb.Any) *HeaderBuilder
WithBaggage configures the builder to set the Baggage field to v, then returns b.
func (*HeaderBuilder) WithCausationId ¶ added in v0.21.0
func (b *HeaderBuilder) WithCausationId(v *uuidpb.UUID) *HeaderBuilder
WithCausationId configures the builder to set the CausationId field to v, then returns b.
func (*HeaderBuilder) WithCorrelationId ¶ added in v0.21.0
func (b *HeaderBuilder) WithCorrelationId(v *uuidpb.UUID) *HeaderBuilder
WithCorrelationId configures the builder to set the CorrelationId field to v, then returns b.
func (*HeaderBuilder) WithExtensions ¶ added in v0.21.0
func (b *HeaderBuilder) WithExtensions(v []*anypb.Any) *HeaderBuilder
WithExtensions configures the builder to set the Extensions field to v, then returns b.
func (*HeaderBuilder) WithSource ¶ added in v0.21.0
func (b *HeaderBuilder) WithSource(v *Source) *HeaderBuilder
WithSource configures the builder to set the Source field to v, then returns b.
type Header_builder ¶ added in v0.23.0
type Header_builder struct {
// CausationId is the (optional) ID of the message that was the direct cause
// of the messages.
//
// If it is the zero-value, the messages were not caused by any other
// message.
CausationId *uuidpb.UUID
// CorrelationId is the (optional) ID of the first ancestor of the messages
// that was itself not caused by another message, that is, it's the root of
// the message chain that ultimately resulted in these messages.
//
// If it is the zero-value, the messages were not caused by any other
// message.
CorrelationId *uuidpb.UUID
// Source identifies the origin of the messages.
Source *Source
// Extensions is a set of extension values associated with the messages,
// their causal chain, or the envelope itself.
Extensions []*anypb.Any
// Baggage is a set of extension values that are propagated through the
// entire causal chain of messages.
Baggage []*anypb.Any
// contains filtered or unexported fields
}
func (Header_builder) Build ¶ added in v0.23.0
func (b0 Header_builder) Build() *Header
type Message ¶ added in v0.21.0
type Message struct {
// contains filtered or unexported fields
}
Message is the serialized representation of a dogma.Message.
func (*Message) ClearTypeId ¶ added in v0.23.0
func (x *Message) ClearTypeId()
func (*Message) Format ¶ added in v0.27.0
Format formats x according to the given fmt verb.
It implements fmt.Formatter, taking precedence over the String() method generated by the Protocol Buffers compiler.
For the %s and %q verbs it uses the string returned by x.AsString() if x provides such a method. For the %#v verb it uses the string returned by x.GoString() if x provides such a method. Otherwise it formats x as though this method were not defined.
AsString() and GoString() are called even when x is nil, since some message types handle a nil receiver themselves. If either method panics, the panic is formatted the same way the fmt package formats a panicking String() method.
func (*Message) GetDescription ¶ added in v0.21.0
func (*Message) MarshalBinary ¶ added in v0.21.0
MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).
It allows *Message to implement encoding.BinaryMarshaler.
func (*Message) ProtoMessage ¶ added in v0.21.0
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶ added in v0.21.0
func (x *Message) ProtoReflect() protoreflect.Message
func (*Message) SetDescription ¶ added in v0.21.0
func (*Message) UnmarshalBinary ¶ added in v0.21.0
UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).
It allows *Message to implement encoding.BinaryUnmarshaler.
type MessageBuilder ¶ added in v0.21.0
type MessageBuilder struct {
// contains filtered or unexported fields
}
func NewMessageBuilder ¶ added in v0.21.0
func NewMessageBuilder() *MessageBuilder
NewMessageBuilder returns a builder that constructs Message messages.
func (*MessageBuilder) Build ¶ added in v0.21.0
func (b *MessageBuilder) Build() *Message
Build returns a new Message containing the values configured via the builder.
Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.
func (*MessageBuilder) From ¶ added in v0.21.0
func (b *MessageBuilder) From(x *Message) *MessageBuilder
From configures the builder to use x as the prototype for new messages, then returns b.
It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.
func (*MessageBuilder) WithData ¶ added in v0.21.0
func (b *MessageBuilder) WithData(v []byte) *MessageBuilder
WithData configures the builder to set the Data field to v, then returns b.
func (*MessageBuilder) WithDescription ¶ added in v0.21.0
func (b *MessageBuilder) WithDescription(v string) *MessageBuilder
WithDescription configures the builder to set the Description field to v, then returns b.
func (*MessageBuilder) WithTypeId ¶ added in v0.21.0
func (b *MessageBuilder) WithTypeId(v *uuidpb.UUID) *MessageBuilder
WithTypeId configures the builder to set the TypeId field to v, then returns b.
type Message_builder ¶ added in v0.23.0
type Message_builder struct {
// TypeId is a unique identifier for the type of message, as per the Dogma
// message type registry.
TypeId *uuidpb.UUID
// Description is a human-readable description of the message, as returned by
// the [dogma.Message.MessageDescription] method.
Description string
// Data is the binary message data obtained by calling
// [dogma.Message.MarshalBinary] on the message.
Data []byte
// contains filtered or unexported fields
}
func (Message_builder) Build ¶ added in v0.23.0
func (b0 Message_builder) Build() *Message
type MultiEnvelope ¶ added in v0.21.0
type MultiEnvelope struct {
// contains filtered or unexported fields
}
MultiEnvelope is an efficient encoding of an ordered sequence of Envelope values that share common header context.
func (*MultiEnvelope) All ¶ added in v0.26.2
func (x *MultiEnvelope) All() iter.Seq[*Envelope]
All returns an iterator over each message in x as a standalone Envelope.
func (*MultiEnvelope) AppendBodies ¶ added in v0.27.0
func (x *MultiEnvelope) AppendBodies(bodies ...*Body)
AppendBodies appends the given bodies to x.
func (*MultiEnvelope) ClearHeader ¶ added in v0.23.0
func (x *MultiEnvelope) ClearHeader()
func (*MultiEnvelope) Format ¶ added in v0.27.0
func (x *MultiEnvelope) Format(f fmt.State, verb rune)
Format formats x according to the given fmt verb.
It implements fmt.Formatter, taking precedence over the String() method generated by the Protocol Buffers compiler.
For the %s and %q verbs it uses the string returned by x.AsString() if x provides such a method. For the %#v verb it uses the string returned by x.GoString() if x provides such a method. Otherwise it formats x as though this method were not defined.
AsString() and GoString() are called even when x is nil, since some message types handle a nil receiver themselves. If either method panics, the panic is formatted the same way the fmt package formats a panicking String() method.
func (*MultiEnvelope) GetBodies ¶ added in v0.21.0
func (x *MultiEnvelope) GetBodies() []*Body
func (*MultiEnvelope) GetHeader ¶ added in v0.21.0
func (x *MultiEnvelope) GetHeader() *Header
func (*MultiEnvelope) HasHeader ¶ added in v0.23.0
func (x *MultiEnvelope) HasHeader() bool
func (*MultiEnvelope) MarshalBinary ¶ added in v0.21.0
func (x *MultiEnvelope) MarshalBinary() ([]byte, error)
MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).
It allows *MultiEnvelope to implement encoding.BinaryMarshaler.
func (*MultiEnvelope) ProtoMessage ¶ added in v0.21.0
func (*MultiEnvelope) ProtoMessage()
func (*MultiEnvelope) ProtoReflect ¶ added in v0.21.0
func (x *MultiEnvelope) ProtoReflect() protoreflect.Message
func (*MultiEnvelope) Reset ¶ added in v0.21.0
func (x *MultiEnvelope) Reset()
func (*MultiEnvelope) SetBodies ¶ added in v0.21.0
func (x *MultiEnvelope) SetBodies(v []*Body)
func (*MultiEnvelope) SetHeader ¶ added in v0.21.0
func (x *MultiEnvelope) SetHeader(v *Header)
func (*MultiEnvelope) String ¶ added in v0.21.0
func (x *MultiEnvelope) String() string
func (*MultiEnvelope) TryAppendEnvelope ¶ added in v0.27.0
func (x *MultiEnvelope) TryAppendEnvelope(env *Envelope) bool
TryAppendEnvelope attempts to append the body from the given envelope to x.
It requires that x and env share equivalent headers. If they do not, it returns false and does not modify x.
func (*MultiEnvelope) UnmarshalBinary ¶ added in v0.21.0
func (x *MultiEnvelope) UnmarshalBinary(data []byte) error
UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).
It allows *MultiEnvelope to implement encoding.BinaryUnmarshaler.
func (*MultiEnvelope) Validate ¶ added in v0.21.0
func (x *MultiEnvelope) Validate() error
Validate returns an error if x is not well-formed.
Well-formedness means that all compulsory fields are populated and that no incompatible fields are populated.
It is intentionally 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.
type MultiEnvelopeBuilder ¶ added in v0.21.0
type MultiEnvelopeBuilder struct {
// contains filtered or unexported fields
}
func NewMultiEnvelopeBuilder ¶ added in v0.21.0
func NewMultiEnvelopeBuilder() *MultiEnvelopeBuilder
NewMultiEnvelopeBuilder returns a builder that constructs MultiEnvelope messages.
func (*MultiEnvelopeBuilder) Build ¶ added in v0.21.0
func (b *MultiEnvelopeBuilder) Build() *MultiEnvelope
Build returns a new MultiEnvelope containing the values configured via the builder.
Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.
func (*MultiEnvelopeBuilder) From ¶ added in v0.21.0
func (b *MultiEnvelopeBuilder) From(x *MultiEnvelope) *MultiEnvelopeBuilder
From configures the builder to use x as the prototype for new messages, then returns b.
It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.
func (*MultiEnvelopeBuilder) WithBodies ¶ added in v0.21.0
func (b *MultiEnvelopeBuilder) WithBodies(v []*Body) *MultiEnvelopeBuilder
WithBodies configures the builder to set the Bodies field to v, then returns b.
func (*MultiEnvelopeBuilder) WithHeader ¶ added in v0.21.0
func (b *MultiEnvelopeBuilder) WithHeader(v *Header) *MultiEnvelopeBuilder
WithHeader configures the builder to set the Header field to v, then returns b.
type MultiEnvelope_builder ¶ added in v0.23.0
type MultiEnvelope_builder struct {
Header *Header
Bodies []*Body
// contains filtered or unexported fields
}
func (MultiEnvelope_builder) Build ¶ added in v0.23.0
func (b0 MultiEnvelope_builder) Build() *MultiEnvelope
type PackCommandOption ¶ added in v0.22.0
type PackCommandOption interface {
// contains filtered or unexported methods
}
PackCommandOption is an option that modifies the behavior of Packer.PackCommand.
func WithIdempotencyKey ¶ added in v0.20.1
func WithIdempotencyKey(key string) PackCommandOption
WithIdempotencyKey sets the idempotency key of a command packed via Packer.PackCommand.
type PackEffectCommandOption ¶ added in v0.22.0
type PackEffectCommandOption interface {
// contains filtered or unexported methods
}
PackEffectCommandOption is an option that modifies the behavior of EffectPacker.PackCommand.
type PackEffectDeadlineOption ¶ added in v0.26.0
type PackEffectDeadlineOption interface {
// contains filtered or unexported methods
}
PackEffectDeadlineOption is an option that modifies the behavior of EffectPacker.PackDeadline.
func WithScheduledFor ¶ added in v0.12.1
func WithScheduledFor(t time.Time) PackEffectDeadlineOption
WithScheduledFor sets the time at which a deadline is reached when packed via EffectPacker.PackDeadline.
type PackEffectEventOption ¶ added in v0.22.0
type PackEffectEventOption interface {
// contains filtered or unexported methods
}
PackEffectEventOption is an option that modifies the behavior of EffectPacker.PackEvent.
type PackEffectsOption ¶ added in v0.22.0
type PackEffectsOption interface {
// contains filtered or unexported methods
}
PackEffectsOption is an option that modifies the behavior of Packer.PackEffects.
func WithInstanceID ¶ added in v0.12.1
func WithInstanceID(id string) PackEffectsOption
WithInstanceID sets the aggregate or process instance ID that is the source of messages packed via Packer.PackEffects.
type Packer ¶ added in v0.12.1
type Packer struct {
// Site is the (optional) identity of the site that the source application
// is running within.
//
// The site is used to disambiguate between messages from different
// installations of the same application.
Site *identitypb.Identity
// Application is the identity of the application that is the source of the
// messages.
Application *identitypb.Identity
// GenerateID is a function used to generate new message IDs.
//
// If it is nil, a random UUID is generated.
GenerateID func() *uuidpb.UUID
// Now is a function used to get the current time. If it is nil, time.Now()
// is used.
Now func() time.Time
}
A Packer puts messages into envelopes.
func (*Packer) PackCommand ¶ added in v0.22.0
func (p *Packer) PackCommand(m dogma.Command, options ...PackCommandOption) *Envelope
PackCommand returns an envelope containing the given command.
func (*Packer) PackEffects ¶ added in v0.22.0
func (p *Packer) PackEffects( cause *Envelope, h *identitypb.Identity, options ...PackEffectsOption, ) *EffectPacker
PackEffects returns an EffectPacker that packs messages produced by h while handling cause.
type Source ¶ added in v0.21.0
type Source struct {
// contains filtered or unexported fields
}
Source identifies where a message originated.
func (*Source) ClearApplication ¶ added in v0.23.0
func (x *Source) ClearApplication()
func (*Source) ClearHandler ¶ added in v0.23.0
func (x *Source) ClearHandler()
func (*Source) Format ¶ added in v0.27.0
Format formats x according to the given fmt verb.
It implements fmt.Formatter, taking precedence over the String() method generated by the Protocol Buffers compiler.
For the %s and %q verbs it uses the string returned by x.AsString() if x provides such a method. For the %#v verb it uses the string returned by x.GoString() if x provides such a method. Otherwise it formats x as though this method were not defined.
AsString() and GoString() are called even when x is nil, since some message types handle a nil receiver themselves. If either method panics, the panic is formatted the same way the fmt package formats a panicking String() method.
func (*Source) GetApplication ¶ added in v0.21.0
func (x *Source) GetApplication() *identitypb.Identity
func (*Source) GetHandler ¶ added in v0.21.0
func (x *Source) GetHandler() *identitypb.Identity
func (*Source) GetInstanceId ¶ added in v0.21.0
func (*Source) GetSite ¶ added in v0.21.0
func (x *Source) GetSite() *identitypb.Identity
func (*Source) HasApplication ¶ added in v0.23.0
func (*Source) HasHandler ¶ added in v0.23.0
func (*Source) MarshalBinary ¶ added in v0.21.0
MarshalBinary returns the binary representation of the message, equivalent to calling proto.Marshal(x).
It allows *Source to implement encoding.BinaryMarshaler.
func (*Source) ProtoMessage ¶ added in v0.21.0
func (*Source) ProtoMessage()
func (*Source) ProtoReflect ¶ added in v0.21.0
func (x *Source) ProtoReflect() protoreflect.Message
func (*Source) SetApplication ¶ added in v0.21.0
func (x *Source) SetApplication(v *identitypb.Identity)
func (*Source) SetHandler ¶ added in v0.21.0
func (x *Source) SetHandler(v *identitypb.Identity)
func (*Source) SetInstanceId ¶ added in v0.21.0
func (*Source) SetSite ¶ added in v0.21.0
func (x *Source) SetSite(v *identitypb.Identity)
func (*Source) UnmarshalBinary ¶ added in v0.21.0
UnmarshalBinary populates x from its binary representation, equivalent to calling proto.Unmarshal(data, x).
It allows *Source to implement encoding.BinaryUnmarshaler.
type SourceBuilder ¶ added in v0.21.0
type SourceBuilder struct {
// contains filtered or unexported fields
}
func NewSourceBuilder ¶ added in v0.21.0
func NewSourceBuilder() *SourceBuilder
NewSourceBuilder returns a builder that constructs Source messages.
func (*SourceBuilder) Build ¶ added in v0.21.0
func (b *SourceBuilder) Build() *Source
Build returns a new Source containing the values configured via the builder.
Each call returns a new message, such that future changes to the builder do not modify previously constructed messages.
func (*SourceBuilder) From ¶ added in v0.21.0
func (b *SourceBuilder) From(x *Source) *SourceBuilder
From configures the builder to use x as the prototype for new messages, then returns b.
It performs a shallow copy of x, such that any changes made via the builder do not modify x. It does not make a copy of the field values themselves.
func (*SourceBuilder) WithApplication ¶ added in v0.21.0
func (b *SourceBuilder) WithApplication(v *identitypb.Identity) *SourceBuilder
WithApplication configures the builder to set the Application field to v, then returns b.
func (*SourceBuilder) WithHandler ¶ added in v0.21.0
func (b *SourceBuilder) WithHandler(v *identitypb.Identity) *SourceBuilder
WithHandler configures the builder to set the Handler field to v, then returns b.
func (*SourceBuilder) WithInstanceId ¶ added in v0.21.0
func (b *SourceBuilder) WithInstanceId(v string) *SourceBuilder
WithInstanceId configures the builder to set the InstanceId field to v, then returns b.
func (*SourceBuilder) WithSite ¶ added in v0.21.0
func (b *SourceBuilder) WithSite(v *identitypb.Identity) *SourceBuilder
WithSite configures the builder to set the Site field to v, then returns b.
type Source_builder ¶ added in v0.23.0
type Source_builder struct {
// Site is the (optional) identity of the "site" that the source
// application is running within.
//
// The site is used to disambiguate between messages from different
// installations of the same application.
Site *identitypb.Identity
// Application is the identity of the Dogma application that produced the
// message.
Application *identitypb.Identity
// Handler is the identity of the Dogma handler that produced the message.
//
// It is the zero-value if the message was not produced by a handler.
Handler *identitypb.Identity
// InstanceId is the ID of the aggregate or process instance that produced
// the message.
//
// It is empty if the message was not produced by an aggregate or process
// handler.
InstanceId string
// contains filtered or unexported fields
}
func (Source_builder) Build ¶ added in v0.23.0
func (b0 Source_builder) Build() *Source