IncludeHistory instructs the key watcher to include historical values as well.
()
| 170 | |
| 171 | // IncludeHistory instructs the key watcher to include historical values as well. |
| 172 | func IncludeHistory() WatchOpt { |
| 173 | return watchOptFn(func(opts *watchOpts) error { |
| 174 | if opts.updatesOnly { |
| 175 | return errors.New("nats: include history can not be used with updates only") |
| 176 | } |
| 177 | opts.includeHistory = true |
| 178 | return nil |
| 179 | }) |
| 180 | } |
| 181 | |
| 182 | // UpdatesOnly instructs the key watcher to only include updates on values (without latest values when started). |
| 183 | func UpdatesOnly() WatchOpt { |