mocks

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter struct {
	mock.Mock
}

Limiter is an autogenerated mock type for the Limiter type

func NewLimiter

func NewLimiter(t interface {
	mock.TestingT
	Cleanup(func())
}) *Limiter

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) Allow

func (_m *Limiter) Allow() bool

Allow provides a mock function with given fields:

func (*Limiter) AllowN

func (_m *Limiter) AllowN(t time.Time, n int) bool

AllowN provides a mock function with given fields: t, n

func (*Limiter) Burst

func (_m *Limiter) Burst() int

Burst provides a mock function with given fields:

func (*Limiter) EXPECT

func (_m *Limiter) EXPECT() *Limiter_Expecter

func (*Limiter) Limit

func (_m *Limiter) Limit() rate.Limit

Limit provides a mock function with given fields:

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) SetBurst

func (_m *Limiter) SetBurst(newBurst int)

SetBurst provides a mock function with given fields: newBurst

func (*Limiter) SetBurstAt

func (_m *Limiter) SetBurstAt(t time.Time, newBurst int)

SetBurstAt provides a mock function with given fields: t, newBurst

func (*Limiter) SetLimit

func (_m *Limiter) SetLimit(newLimit rate.Limit)

SetLimit provides a mock function with given fields: newLimit

func (*Limiter) SetLimitAt

func (_m *Limiter) SetLimitAt(t time.Time, newLimit rate.Limit)

SetLimitAt provides a mock function with given fields: t, newLimit

func (*Limiter) Tokens

func (_m *Limiter) Tokens() float64

Tokens provides a mock function with given fields:

func (*Limiter) TokensAt

func (_m *Limiter) TokensAt(t time.Time) float64

TokensAt provides a mock function with given fields: t

func (*Limiter) Wait

func (_m *Limiter) Wait(ctx context.Context) error

Wait provides a mock function with given fields: ctx

func (*Limiter) WaitN

func (_m *Limiter) WaitN(ctx context.Context, n int) error

WaitN provides a mock function with given fields: ctx, n

type Limiter_AllowN_Call

type Limiter_AllowN_Call struct {
	*mock.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

type Limiter_Allow_Call struct {
	*mock.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

type Limiter_Burst_Call struct {
	*mock.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

type Limiter_Limit_Call struct {
	*mock.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 (*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

type Limiter_ReserveN_Call struct {
	*mock.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 (*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

type Limiter_Reserve_Call

type Limiter_Reserve_Call struct {
	*mock.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 (*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

type Limiter_SetBurstAt_Call struct {
	*mock.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 (*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

type Limiter_SetBurst_Call struct {
	*mock.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 (*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

type Limiter_SetLimitAt_Call struct {
	*mock.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 (*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

type Limiter_SetLimit_Call struct {
	*mock.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 (*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

type Limiter_TokensAt_Call struct {
	*mock.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 (*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

type Limiter_Tokens_Call struct {
	*mock.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 (*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

type Limiter_WaitN_Call struct {
	*mock.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

type Limiter_Wait_Call struct {
	*mock.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

type Reservation struct {
	mock.Mock
}

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

type Reservation_CancelAt_Call struct {
	*mock.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 (*Reservation_CancelAt_Call) Run

func (*Reservation_CancelAt_Call) RunAndReturn

func (_c *Reservation_CancelAt_Call) RunAndReturn(run func(time.Time)) *Reservation_CancelAt_Call

type Reservation_Cancel_Call

type Reservation_Cancel_Call struct {
	*mock.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 (*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

type Reservation_DelayFrom_Call struct {
	*mock.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 (*Reservation_DelayFrom_Call) Run

func (*Reservation_DelayFrom_Call) RunAndReturn

type Reservation_Delay_Call

type Reservation_Delay_Call struct {
	*mock.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 (*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

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

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

OK is a helper method to define mock.On call

type Reservation_OK_Call

type Reservation_OK_Call struct {
	*mock.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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL