snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s

This commit is contained in:
upstream-mirror
2026-09-15 21:27:46 +05:00
commit ce933d1277
538 changed files with 46504 additions and 0 deletions

18
message/metadata.go Normal file
View File

@@ -0,0 +1,18 @@
package message
// Metadata is sent with every message to provide extra context without unmarshaling the message payload.
type Metadata map[string]string
// Get returns the metadata value for the given key. If the key is not found, an empty string is returned.
func (m Metadata) Get(key string) string {
if v, ok := m[key]; ok {
return v
}
return ""
}
// Set sets the metadata key to value.
func (m Metadata) Set(key, value string) {
m[key] = value
}