SetReuseTargetStruct sets whether to reuse the same target struct or create a new one on updates
(reuse bool)
| 215 | |
| 216 | // SetReuseTargetStruct sets whether to reuse the same target struct or create a new one on updates |
| 217 | func (l *Loader[T]) SetReuseTargetStruct(reuse bool) *Loader[T] { |
| 218 | l.mutex.Lock() |
| 219 | defer l.mutex.Unlock() |
| 220 | l.reuse = reuse |
| 221 | return l |
| 222 | } |
| 223 | |
| 224 | // StopWatch stops watching for configuration changes and removes the associated watcher |
| 225 | func (l *Loader[T]) StopWatch(ctx context.Context) (bool, error) { |