Documentation
¶
Index ¶
- type Limiter
- func (_m *Limiter) Allow() bool
- func (_m *Limiter) AllowN(t time.Time, n int) bool
- func (_m *Limiter) Burst() int
- func (_m *Limiter) EXPECT() *Limiter_Expecter
- func (_m *Limiter) Limit() rate.Limit
- func (_m *Limiter) Reserve() interfaces.Reservation
- func (_m *Limiter) ReserveN(t time.Time, n int) interfaces.Reservation
- func (_m *Limiter) SetBurst(newBurst int)
- func (_m *Limiter) SetBurstAt(t time.Time, newBurst int)
- func (_m *Limiter) SetLimit(newLimit rate.Limit)
- func (_m *Limiter) SetLimitAt(t time.Time, newLimit rate.Limit)
- func (_m *Limiter) Tokens() float64
- func (_m *Limiter) TokensAt(t time.Time) float64
- func (_m *Limiter) Wait(ctx context.Context) error
- func (_m *Limiter) WaitN(ctx context.Context, n int) error
- type Limiter_AllowN_Call
- type Limiter_Allow_Call
- type Limiter_Burst_Call
- type Limiter_Expecter
- func (_e *Limiter_Expecter) Allow() *Limiter_Allow_Call
- func (_e *Limiter_Expecter) AllowN(t interface{}, n interface{}) *Limiter_AllowN_Call
- func (_e *Limiter_Expecter) Burst() *Limiter_Burst_Call
- func (_e *Limiter_Expecter) Limit() *Limiter_Limit_Call
- func (_e *Limiter_Expecter) Reserve() *Limiter_Reserve_Call
- func (_e *Limiter_Expecter) ReserveN(t interface{}, n interface{}) *Limiter_ReserveN_Call
- func (_e *Limiter_Expecter) SetBurst(newBurst interface{}) *Limiter_SetBurst_Call
- func (_e *Limiter_Expecter) SetBurstAt(t interface{}, newBurst interface{}) *Limiter_SetBurstAt_Call
- func (_e *Limiter_Expecter) SetLimit(newLimit interface{}) *Limiter_SetLimit_Call
- func (_e *Limiter_Expecter) SetLimitAt(t interface{}, newLimit interface{}) *Limiter_SetLimitAt_Call
- func (_e *Limiter_Expecter) Tokens() *Limiter_Tokens_Call
- func (_e *Limiter_Expecter) TokensAt(t interface{}) *Limiter_TokensAt_Call
- func (_e *Limiter_Expecter) Wait(ctx interface{}) *Limiter_Wait_Call
- func (_e *Limiter_Expecter) WaitN(ctx interface{}, n interface{}) *Limiter_WaitN_Call
- type Limiter_Limit_Call
- type Limiter_ReserveN_Call
- type Limiter_Reserve_Call
- type Limiter_SetBurstAt_Call
- type Limiter_SetBurst_Call
- type Limiter_SetLimitAt_Call
- type Limiter_SetLimit_Call
- type Limiter_TokensAt_Call
- type Limiter_Tokens_Call
- type Limiter_WaitN_Call
- type Limiter_Wait_Call
- type Reservation
- type Reservation_CancelAt_Call
- type Reservation_Cancel_Call
- type Reservation_DelayFrom_Call
- type Reservation_Delay_Call
- type Reservation_Expecter
- func (_e *Reservation_Expecter) Cancel() *Reservation_Cancel_Call
- func (_e *Reservation_Expecter) CancelAt(t interface{}) *Reservation_CancelAt_Call
- func (_e *Reservation_Expecter) Delay() *Reservation_Delay_Call
- func (_e *Reservation_Expecter) DelayFrom(t interface{}) *Reservation_DelayFrom_Call
- func (_e *Reservation_Expecter) OK() *Reservation_OK_Call
- type Reservation_OK_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
Limiter is an autogenerated mock type for the Limiter type
func NewLimiter ¶
NewLimiter creates a new instance of Limiter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*Limiter) EXPECT ¶
func (_m *Limiter) EXPECT() *Limiter_Expecter
func (*Limiter) Reserve ¶
func (_m *Limiter) Reserve() interfaces.Reservation
Reserve provides a mock function with given fields:
func (*Limiter) ReserveN ¶
func (_m *Limiter) ReserveN(t time.Time, n int) interfaces.Reservation
ReserveN provides a mock function with given fields: t, n
func (*Limiter) SetBurstAt ¶
SetBurstAt provides a mock function with given fields: t, newBurst
func (*Limiter) SetLimitAt ¶
SetLimitAt provides a mock function with given fields: t, newLimit
type Limiter_AllowN_Call ¶
Limiter_AllowN_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllowN'
func (*Limiter_AllowN_Call) Return ¶
func (_c *Limiter_AllowN_Call) Return(_a0 bool) *Limiter_AllowN_Call
func (*Limiter_AllowN_Call) Run ¶
func (_c *Limiter_AllowN_Call) Run(run func(t time.Time, n int)) *Limiter_AllowN_Call
func (*Limiter_AllowN_Call) RunAndReturn ¶
func (_c *Limiter_AllowN_Call) RunAndReturn(run func(time.Time, int) bool) *Limiter_AllowN_Call
type Limiter_Allow_Call ¶
Limiter_Allow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Allow'
func (*Limiter_Allow_Call) Return ¶
func (_c *Limiter_Allow_Call) Return(_a0 bool) *Limiter_Allow_Call
func (*Limiter_Allow_Call) Run ¶
func (_c *Limiter_Allow_Call) Run(run func()) *Limiter_Allow_Call
func (*Limiter_Allow_Call) RunAndReturn ¶
func (_c *Limiter_Allow_Call) RunAndReturn(run func() bool) *Limiter_Allow_Call
type Limiter_Burst_Call ¶
Limiter_Burst_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Burst'
func (*Limiter_Burst_Call) Return ¶
func (_c *Limiter_Burst_Call) Return(_a0 int) *Limiter_Burst_Call
func (*Limiter_Burst_Call) Run ¶
func (_c *Limiter_Burst_Call) Run(run func()) *Limiter_Burst_Call
func (*Limiter_Burst_Call) RunAndReturn ¶
func (_c *Limiter_Burst_Call) RunAndReturn(run func() int) *Limiter_Burst_Call
type Limiter_Expecter ¶
type Limiter_Expecter struct {
// contains filtered or unexported fields
}
func (*Limiter_Expecter) Allow ¶
func (_e *Limiter_Expecter) Allow() *Limiter_Allow_Call
Allow is a helper method to define mock.On call
func (*Limiter_Expecter) AllowN ¶
func (_e *Limiter_Expecter) AllowN(t interface{}, n interface{}) *Limiter_AllowN_Call
AllowN is a helper method to define mock.On call
- t time.Time
- n int
func (*Limiter_Expecter) Burst ¶
func (_e *Limiter_Expecter) Burst() *Limiter_Burst_Call
Burst is a helper method to define mock.On call
func (*Limiter_Expecter) Limit ¶
func (_e *Limiter_Expecter) Limit() *Limiter_Limit_Call
Limit is a helper method to define mock.On call
func (*Limiter_Expecter) Reserve ¶
func (_e *Limiter_Expecter) Reserve() *Limiter_Reserve_Call
Reserve is a helper method to define mock.On call
func (*Limiter_Expecter) ReserveN ¶
func (_e *Limiter_Expecter) ReserveN(t interface{}, n interface{}) *Limiter_ReserveN_Call
ReserveN is a helper method to define mock.On call
- t time.Time
- n int
func (*Limiter_Expecter) SetBurst ¶
func (_e *Limiter_Expecter) SetBurst(newBurst interface{}) *Limiter_SetBurst_Call
SetBurst is a helper method to define mock.On call
- newBurst int
func (*Limiter_Expecter) SetBurstAt ¶
func (_e *Limiter_Expecter) SetBurstAt(t interface{}, newBurst interface{}) *Limiter_SetBurstAt_Call
SetBurstAt is a helper method to define mock.On call
- t time.Time
- newBurst int
func (*Limiter_Expecter) SetLimit ¶
func (_e *Limiter_Expecter) SetLimit(newLimit interface{}) *Limiter_SetLimit_Call
SetLimit is a helper method to define mock.On call
- newLimit rate.Limit
func (*Limiter_Expecter) SetLimitAt ¶
func (_e *Limiter_Expecter) SetLimitAt(t interface{}, newLimit interface{}) *Limiter_SetLimitAt_Call
SetLimitAt is a helper method to define mock.On call
- t time.Time
- newLimit rate.Limit
func (*Limiter_Expecter) Tokens ¶
func (_e *Limiter_Expecter) Tokens() *Limiter_Tokens_Call
Tokens is a helper method to define mock.On call
func (*Limiter_Expecter) TokensAt ¶
func (_e *Limiter_Expecter) TokensAt(t interface{}) *Limiter_TokensAt_Call
TokensAt is a helper method to define mock.On call
- t time.Time
func (*Limiter_Expecter) Wait ¶
func (_e *Limiter_Expecter) Wait(ctx interface{}) *Limiter_Wait_Call
Wait is a helper method to define mock.On call
- ctx context.Context
func (*Limiter_Expecter) WaitN ¶
func (_e *Limiter_Expecter) WaitN(ctx interface{}, n interface{}) *Limiter_WaitN_Call
WaitN is a helper method to define mock.On call
- ctx context.Context
- n int
type Limiter_Limit_Call ¶
Limiter_Limit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Limit'
func (*Limiter_Limit_Call) Return ¶
func (_c *Limiter_Limit_Call) Return(_a0 rate.Limit) *Limiter_Limit_Call
func (*Limiter_Limit_Call) Run ¶
func (_c *Limiter_Limit_Call) Run(run func()) *Limiter_Limit_Call
func (*Limiter_Limit_Call) RunAndReturn ¶
func (_c *Limiter_Limit_Call) RunAndReturn(run func() rate.Limit) *Limiter_Limit_Call
type Limiter_ReserveN_Call ¶
Limiter_ReserveN_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReserveN'
func (*Limiter_ReserveN_Call) Return ¶
func (_c *Limiter_ReserveN_Call) Return(_a0 interfaces.Reservation) *Limiter_ReserveN_Call
func (*Limiter_ReserveN_Call) Run ¶
func (_c *Limiter_ReserveN_Call) Run(run func(t time.Time, n int)) *Limiter_ReserveN_Call
func (*Limiter_ReserveN_Call) RunAndReturn ¶
func (_c *Limiter_ReserveN_Call) RunAndReturn(run func(time.Time, int) interfaces.Reservation) *Limiter_ReserveN_Call
type Limiter_Reserve_Call ¶
Limiter_Reserve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reserve'
func (*Limiter_Reserve_Call) Return ¶
func (_c *Limiter_Reserve_Call) Return(_a0 interfaces.Reservation) *Limiter_Reserve_Call
func (*Limiter_Reserve_Call) Run ¶
func (_c *Limiter_Reserve_Call) Run(run func()) *Limiter_Reserve_Call
func (*Limiter_Reserve_Call) RunAndReturn ¶
func (_c *Limiter_Reserve_Call) RunAndReturn(run func() interfaces.Reservation) *Limiter_Reserve_Call
type Limiter_SetBurstAt_Call ¶
Limiter_SetBurstAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBurstAt'
func (*Limiter_SetBurstAt_Call) Return ¶
func (_c *Limiter_SetBurstAt_Call) Return() *Limiter_SetBurstAt_Call
func (*Limiter_SetBurstAt_Call) Run ¶
func (_c *Limiter_SetBurstAt_Call) Run(run func(t time.Time, newBurst int)) *Limiter_SetBurstAt_Call
func (*Limiter_SetBurstAt_Call) RunAndReturn ¶
func (_c *Limiter_SetBurstAt_Call) RunAndReturn(run func(time.Time, int)) *Limiter_SetBurstAt_Call
type Limiter_SetBurst_Call ¶
Limiter_SetBurst_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBurst'
func (*Limiter_SetBurst_Call) Return ¶
func (_c *Limiter_SetBurst_Call) Return() *Limiter_SetBurst_Call
func (*Limiter_SetBurst_Call) Run ¶
func (_c *Limiter_SetBurst_Call) Run(run func(newBurst int)) *Limiter_SetBurst_Call
func (*Limiter_SetBurst_Call) RunAndReturn ¶
func (_c *Limiter_SetBurst_Call) RunAndReturn(run func(int)) *Limiter_SetBurst_Call
type Limiter_SetLimitAt_Call ¶
Limiter_SetLimitAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLimitAt'
func (*Limiter_SetLimitAt_Call) Return ¶
func (_c *Limiter_SetLimitAt_Call) Return() *Limiter_SetLimitAt_Call
func (*Limiter_SetLimitAt_Call) Run ¶
func (_c *Limiter_SetLimitAt_Call) Run(run func(t time.Time, newLimit rate.Limit)) *Limiter_SetLimitAt_Call
func (*Limiter_SetLimitAt_Call) RunAndReturn ¶
func (_c *Limiter_SetLimitAt_Call) RunAndReturn(run func(time.Time, rate.Limit)) *Limiter_SetLimitAt_Call
type Limiter_SetLimit_Call ¶
Limiter_SetLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLimit'
func (*Limiter_SetLimit_Call) Return ¶
func (_c *Limiter_SetLimit_Call) Return() *Limiter_SetLimit_Call
func (*Limiter_SetLimit_Call) Run ¶
func (_c *Limiter_SetLimit_Call) Run(run func(newLimit rate.Limit)) *Limiter_SetLimit_Call
func (*Limiter_SetLimit_Call) RunAndReturn ¶
func (_c *Limiter_SetLimit_Call) RunAndReturn(run func(rate.Limit)) *Limiter_SetLimit_Call
type Limiter_TokensAt_Call ¶
Limiter_TokensAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TokensAt'
func (*Limiter_TokensAt_Call) Return ¶
func (_c *Limiter_TokensAt_Call) Return(_a0 float64) *Limiter_TokensAt_Call
func (*Limiter_TokensAt_Call) Run ¶
func (_c *Limiter_TokensAt_Call) Run(run func(t time.Time)) *Limiter_TokensAt_Call
func (*Limiter_TokensAt_Call) RunAndReturn ¶
func (_c *Limiter_TokensAt_Call) RunAndReturn(run func(time.Time) float64) *Limiter_TokensAt_Call
type Limiter_Tokens_Call ¶
Limiter_Tokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tokens'
func (*Limiter_Tokens_Call) Return ¶
func (_c *Limiter_Tokens_Call) Return(_a0 float64) *Limiter_Tokens_Call
func (*Limiter_Tokens_Call) Run ¶
func (_c *Limiter_Tokens_Call) Run(run func()) *Limiter_Tokens_Call
func (*Limiter_Tokens_Call) RunAndReturn ¶
func (_c *Limiter_Tokens_Call) RunAndReturn(run func() float64) *Limiter_Tokens_Call
type Limiter_WaitN_Call ¶
Limiter_WaitN_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitN'
func (*Limiter_WaitN_Call) Return ¶
func (_c *Limiter_WaitN_Call) Return(err error) *Limiter_WaitN_Call
func (*Limiter_WaitN_Call) Run ¶
func (_c *Limiter_WaitN_Call) Run(run func(ctx context.Context, n int)) *Limiter_WaitN_Call
func (*Limiter_WaitN_Call) RunAndReturn ¶
func (_c *Limiter_WaitN_Call) RunAndReturn(run func(context.Context, int) error) *Limiter_WaitN_Call
type Limiter_Wait_Call ¶
Limiter_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait'
func (*Limiter_Wait_Call) Return ¶
func (_c *Limiter_Wait_Call) Return(err error) *Limiter_Wait_Call
func (*Limiter_Wait_Call) Run ¶
func (_c *Limiter_Wait_Call) Run(run func(ctx context.Context)) *Limiter_Wait_Call
func (*Limiter_Wait_Call) RunAndReturn ¶
func (_c *Limiter_Wait_Call) RunAndReturn(run func(context.Context) error) *Limiter_Wait_Call
type Reservation ¶
Reservation is an autogenerated mock type for the Reservation type
func NewReservation ¶
func NewReservation(t interface { mock.TestingT Cleanup(func()) }) *Reservation
NewReservation creates a new instance of Reservation. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*Reservation) Cancel ¶
func (_m *Reservation) Cancel()
Cancel provides a mock function with given fields:
func (*Reservation) CancelAt ¶
func (_m *Reservation) CancelAt(t time.Time)
CancelAt provides a mock function with given fields: t
func (*Reservation) Delay ¶
func (_m *Reservation) Delay() time.Duration
Delay provides a mock function with given fields:
func (*Reservation) DelayFrom ¶
func (_m *Reservation) DelayFrom(t time.Time) time.Duration
DelayFrom provides a mock function with given fields: t
func (*Reservation) EXPECT ¶
func (_m *Reservation) EXPECT() *Reservation_Expecter
func (*Reservation) OK ¶
func (_m *Reservation) OK() bool
OK provides a mock function with given fields:
type Reservation_CancelAt_Call ¶
Reservation_CancelAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelAt'
func (*Reservation_CancelAt_Call) Return ¶
func (_c *Reservation_CancelAt_Call) Return() *Reservation_CancelAt_Call
func (*Reservation_CancelAt_Call) Run ¶
func (_c *Reservation_CancelAt_Call) Run(run func(t time.Time)) *Reservation_CancelAt_Call
func (*Reservation_CancelAt_Call) RunAndReturn ¶
func (_c *Reservation_CancelAt_Call) RunAndReturn(run func(time.Time)) *Reservation_CancelAt_Call
type Reservation_Cancel_Call ¶
Reservation_Cancel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cancel'
func (*Reservation_Cancel_Call) Return ¶
func (_c *Reservation_Cancel_Call) Return() *Reservation_Cancel_Call
func (*Reservation_Cancel_Call) Run ¶
func (_c *Reservation_Cancel_Call) Run(run func()) *Reservation_Cancel_Call
func (*Reservation_Cancel_Call) RunAndReturn ¶
func (_c *Reservation_Cancel_Call) RunAndReturn(run func()) *Reservation_Cancel_Call
type Reservation_DelayFrom_Call ¶
Reservation_DelayFrom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DelayFrom'
func (*Reservation_DelayFrom_Call) Return ¶
func (_c *Reservation_DelayFrom_Call) Return(_a0 time.Duration) *Reservation_DelayFrom_Call
func (*Reservation_DelayFrom_Call) Run ¶
func (_c *Reservation_DelayFrom_Call) Run(run func(t time.Time)) *Reservation_DelayFrom_Call
func (*Reservation_DelayFrom_Call) RunAndReturn ¶
func (_c *Reservation_DelayFrom_Call) RunAndReturn(run func(time.Time) time.Duration) *Reservation_DelayFrom_Call
type Reservation_Delay_Call ¶
Reservation_Delay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delay'
func (*Reservation_Delay_Call) Return ¶
func (_c *Reservation_Delay_Call) Return(_a0 time.Duration) *Reservation_Delay_Call
func (*Reservation_Delay_Call) Run ¶
func (_c *Reservation_Delay_Call) Run(run func()) *Reservation_Delay_Call
func (*Reservation_Delay_Call) RunAndReturn ¶
func (_c *Reservation_Delay_Call) RunAndReturn(run func() time.Duration) *Reservation_Delay_Call
type Reservation_Expecter ¶
type Reservation_Expecter struct {
// contains filtered or unexported fields
}
func (*Reservation_Expecter) Cancel ¶
func (_e *Reservation_Expecter) Cancel() *Reservation_Cancel_Call
Cancel is a helper method to define mock.On call
func (*Reservation_Expecter) CancelAt ¶
func (_e *Reservation_Expecter) CancelAt(t interface{}) *Reservation_CancelAt_Call
CancelAt is a helper method to define mock.On call
- t time.Time
func (*Reservation_Expecter) Delay ¶
func (_e *Reservation_Expecter) Delay() *Reservation_Delay_Call
Delay is a helper method to define mock.On call
func (*Reservation_Expecter) DelayFrom ¶
func (_e *Reservation_Expecter) DelayFrom(t interface{}) *Reservation_DelayFrom_Call
DelayFrom is a helper method to define mock.On call
- t time.Time
func (*Reservation_Expecter) OK ¶
func (_e *Reservation_Expecter) OK() *Reservation_OK_Call
OK is a helper method to define mock.On call
type Reservation_OK_Call ¶
Reservation_OK_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OK'
func (*Reservation_OK_Call) Return ¶
func (_c *Reservation_OK_Call) Return(_a0 bool) *Reservation_OK_Call
func (*Reservation_OK_Call) Run ¶
func (_c *Reservation_OK_Call) Run(run func()) *Reservation_OK_Call
func (*Reservation_OK_Call) RunAndReturn ¶
func (_c *Reservation_OK_Call) RunAndReturn(run func() bool) *Reservation_OK_Call