MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / AddOrAppendMetaSlice

Method AddOrAppendMetaSlice

pkg/event/event.go:260–267  ·  view source on GitHub ↗

AddOrAppendMetaSlice puts the provided string into the slice if the key doesn't exist or appends the string to the slice.

(k MetadataKey, s string)

Source from the content-addressed store, hash-verified

258// AddOrAppendMetaSlice puts the provided string into the slice if the key
259// doesn't exist or appends the string to the slice.
260func (e *Event) AddOrAppendMetaSlice(k MetadataKey, s string) {
261 if e.ContainsMeta(k) {
262 v := append(e.GetMeta(k).([]string), s)
263 e.AddMeta(k, v)
264 } else {
265 e.AddMeta(k, []string{s})
266 }
267}
268
269// RemoveMeta removes the event metadata index by given key.
270func (e *Event) RemoveMeta(k MetadataKey) {

Callers 1

ProcessEventMethod · 0.80

Calls 3

ContainsMetaMethod · 0.95
GetMetaMethod · 0.95
AddMetaMethod · 0.95

Tested by

no test coverage detected