AddMeta appends a key/value pair to event's metadata.
(k MetadataKey, v any)
| 247 | |
| 248 | // AddMeta appends a key/value pair to event's metadata. |
| 249 | func (e *Event) AddMeta(k MetadataKey, v any) { |
| 250 | e.mmux.Lock() |
| 251 | defer e.mmux.Unlock() |
| 252 | if e.Metadata == nil { |
| 253 | e.Metadata = make(map[MetadataKey]any) |
| 254 | } |
| 255 | e.Metadata[k] = v |
| 256 | } |
| 257 | |
| 258 | // AddOrAppendMetaSlice puts the provided string into the slice if the key |
| 259 | // doesn't exist or appends the string to the slice. |
no test coverage detected