{"modulePath":"github.com/get-eventually/go-eventually/core","version":"v0.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package message\n\nPackage message exposes the generic Message type, used to represent a message in a system (e.g. Event, Command, etc.).\n\n## Types\n\n```go\ntype Envelope[T Message] struct {\n\tMessage  T\n\tMetadata Metadata\n}\n```\nEnvelope bundles a Message to be exchanged with optional Metadata support.\n\n```go\nfunc (e Envelope[T]) ToGenericEnvelope() GenericEnvelope\n```\nToGenericEnvelope maps the Envelope instance into a GenericEnvelope one.\n\n```go\ntype GenericEnvelope Envelope[Message]\n```\nGenericEnvelope is an Envelope type that can be used when the concrete Message type in the Envelope is not of interest.\n\n```go\ntype Message interface {\n\tName() string\n}\n```\nMessage is a Message payload.\n\nEach payload should have a unique name identifier, that can be used to uniquely route a message to its type.\n\n```go\ntype Metadata map[string]string\n```\nMetadata contains some data related to a Message that are not functional for the Message itself, but instead functioning as supporting information to provide additional context.\n\n```go\nfunc (m Metadata) Merge(other Metadata) Metadata\n```\nMerge merges the other Metadata provided in input with the current map. Returns a pointer to the extended metadata map.\n\n```go\nfunc (m Metadata) With(key, value string) Metadata\n```\nWith returns a new Metadata reference holding the value addressed using the specified key.\n\n","path":"github.com/get-eventually/go-eventually/core/message","name":"message","synopsis":"Package message exposes the generic Message type, used to represent a message in a system (e.g.","isRedistributable":true}
