Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unpack ¶
func Unpack[
T interface {
dogma.Message
Validate(S) error
},
S dogma.MessageValidationScope,
](
data []byte,
envelope *envelopepb.Envelope,
messages ...*T,
) error
Unpack unmarshals an envelope from its binary representation and unpacks the message within it (possibly multiple times).
func UnpackMessage ¶
func UnpackMessage[
T interface {
dogma.Message
Validate(S) error
},
S dogma.MessageValidationScope,
](
envelope *envelopepb.Envelope,
messages ...*T,
) error
UnpackMessage unpacks the message(s) from an already-parsed envelope.
Unlike Unpack, it does not unmarshal the envelope from binary; the caller is responsible for ensuring the envelope is already populated and valid.
Types ¶
type ValidationScope ¶
type ValidationScope struct {
IsNewMessage bool
Envelope *envelopepb.Envelope
}
ValidationScope implements dogma.CommandValidationScope, dogma.EventValidationScope and dogma.DeadlineValidationScope.
func (ValidationScope) ExecutedAt ¶
func (s ValidationScope) ExecutedAt() time.Time
ExecutedAt returns the time at which the application submitted the command for execution.
func (ValidationScope) IsNew ¶
func (s ValidationScope) IsNew() bool
IsNew returns true when a new message is being created message, or false when the engine is re-validating a message that it has already accepted.
func (ValidationScope) RecordedAt ¶
func (s ValidationScope) RecordedAt() time.Time
RecordedAt returns the time at which the event occurred.
func (ValidationScope) ScheduledAt ¶
func (s ValidationScope) ScheduledAt() time.Time
ScheduledAt returns the time at which dogma.ProcessScope.ScheduleDeadline was called.
func (ValidationScope) ScheduledFor ¶
func (s ValidationScope) ScheduledFor() time.Time
ScheduledFor returns the time at which the deadline message is to be delivered.