MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / eventIndexKey

Method eventIndexKey

pkg/events/redis/store.go:63–67  ·  view source on GitHub ↗

eventIndexKey returns the Redis for indexing events with the given correlationID. Since correlation IDs are user input (and can therefore contain characters that we may not want in Redis keys) we hash them.

(_ context.Context, correlationID string)

Source from the content-addressed store, hash-verified

61// Since correlation IDs are user input (and can therefore contain characters that
62// we may not want in Redis keys) we hash them.
63func (ps *PubSubStore) eventIndexKey(_ context.Context, correlationID string) string {
64 h := fnv.New128a()
65 h.Write([]byte(correlationID))
66 return ps.client.Key("event_index", base64.RawStdEncoding.EncodeToString(h.Sum(nil)))
67}
68
69func (ps *PubSubStore) eventStream(ctx context.Context, ids *ttnpb.EntityIdentifiers) string {
70 if ids == nil {

Callers 2

storeEventMethod · 0.95
FindRelatedMethod · 0.95

Calls 2

KeyMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected