MCPcopy
hub / github.com/nats-io/nats.go / generateConsName

Function generateConsName

jetstream/consumer.go:357–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355)
356
357func generateConsName() string {
358 name := nuid.Next()
359 sha := sha256.New()
360 sha.Write([]byte(name))
361 b := sha.Sum(nil)
362 for i := 0; i < 8; i++ {
363 b[i] = rdigits[int(b[i]%base)]
364 }
365 return string(b[:8])
366}
367
368func getConsumer(ctx context.Context, js *jetStream, stream, name string) (Consumer, error) {
369 info, err := fetchConsumerInfo(ctx, js, stream, name)

Callers 1

upsertConsumerFunction · 0.85

Calls 2

NextMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected