WithEventChannel sets the event channel to use for rollup events. This is only used for testing.
(ch chan<- Event)
| 46 | // |
| 47 | // This is only used for testing. |
| 48 | func WithEventChannel(ch chan<- Event) Option { |
| 49 | if flag.Lookup("test.v") == nil { |
| 50 | panic("developer error: WithEventChannel is not to be used outside of tests") |
| 51 | } |
| 52 | return func(r *Rolluper) { |
| 53 | r.event = ch |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // New creates a new DB rollup service that periodically runs rollup queries. |
| 58 | // It is the caller's responsibility to call Close on the returned instance. |
no outgoing calls