NewReflector creates a new Reflector object which will keep the given store up to date with the server's contents for the given resource. Reflector promises to only put things in the store that have the type of expectedType, unless expectedType is nil. If resyncPeriod is non-zero, then lists will be
(lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration)
| 95 | // resyncPeriod, so that you can use reflectors to periodically process everything as |
| 96 | // well as incrementally processing the things that change. |
| 97 | func NewReflector(lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector { |
| 98 | return NewNamedReflector(naming.GetNameFromCallsite(internalPackages...), lw, expectedType, store, resyncPeriod) |
| 99 | } |
| 100 | |
| 101 | // NewNamedReflector same as NewReflector, but with a specified name for logging |
| 102 | func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector { |