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

Function IncludeHistory

jetstream/kv_options.go:29–37  ·  view source on GitHub ↗

IncludeHistory instructs the key watcher to include historical values as well (up to KeyValueMaxHistory).

()

Source from the content-addressed store, hash-verified

27// IncludeHistory instructs the key watcher to include historical values as
28// well (up to KeyValueMaxHistory).
29func IncludeHistory() WatchOpt {
30 return watchOptFn(func(opts *watchOpts) error {
31 if opts.updatesOnly {
32 return fmt.Errorf("%w: include history cannot be used with updates only", ErrInvalidOption)
33 }
34 opts.includeHistory = true
35 return nil
36 })
37}
38
39// UpdatesOnly instructs the key watcher to only include updates on values
40// (without latest values when started).

Callers 2

TestKeyValueWatchFunction · 0.92
HistoryMethod · 0.70

Calls 2

ErrorfMethod · 0.80
watchOptFnFuncType · 0.70

Tested by 1

TestKeyValueWatchFunction · 0.74