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)
| 61 | // Since correlation IDs are user input (and can therefore contain characters that |
| 62 | // we may not want in Redis keys) we hash them. |
| 63 | func (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 | |
| 69 | func (ps *PubSubStore) eventStream(ctx context.Context, ids *ttnpb.EntityIdentifiers) string { |
| 70 | if ids == nil { |
no test coverage detected