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

Method Create

jetstream/kv.go:123–123  ·  view source on GitHub ↗

Create will add the key/value pair if it does not exist. If the key already exists, ErrKeyExists will be returned. A key has to consist of alphanumeric characters, dashes, underscores, equal signs, and dots.

(ctx context.Context, key string, value []byte, opts ...KVCreateOpt)

Source from the content-addressed store, hash-verified

121 // A key has to consist of alphanumeric characters, dashes, underscores,
122 // equal signs, and dots.
123 Create(ctx context.Context, key string, value []byte, opts ...KVCreateOpt) (uint64, error)
124
125 // Update will update the value if the latest revision matches.
126 // If the provided revision is not the latest, Update will return an error.

Callers 8

TestKeyValueBasicsFunction · 0.65
TestKeyValueWatchFunction · 0.65
TestKeyValueCreateFunction · 0.65
TestKeyValueSourcingFunction · 0.65
TestKeyValueBasicsFunction · 0.65
TestKeyValueWatchFunction · 0.65
TestKeyValueCreateFunction · 0.65

Implementers 1

kvsjetstream/kv.go

Calls

no outgoing calls

Tested by 8

TestKeyValueBasicsFunction · 0.52
TestKeyValueWatchFunction · 0.52
TestKeyValueCreateFunction · 0.52
TestKeyValueSourcingFunction · 0.52
TestKeyValueBasicsFunction · 0.52
TestKeyValueWatchFunction · 0.52
TestKeyValueCreateFunction · 0.52