IncludeHistory instructs the key watcher to include historical values as well (up to KeyValueMaxHistory).
()
| 27 | // IncludeHistory instructs the key watcher to include historical values as |
| 28 | // well (up to KeyValueMaxHistory). |
| 29 | func 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). |