package rproxy import "time" // Breaker is the circuit breaker, for tests that give it the time. type Breaker struct { b breaker } // MayAsk reports whether a request may ask waf at now. func (b *Breaker) MayAsk(now time.Time) bool { return b.b.mayAsk(now) } // NoteAnswer notes that an ask got an answer in time. func (b *Breaker) NoteAnswer() { b.b.noteAnswer() } // NoteFailure notes that an ask that ended at now got no answer in time. func (b *Breaker) NoteFailure(now time.Time) { b.b.noteFailure(now) }