slidinglog

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package slidinglog is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLimiter

func NewLimiter(client *redis.Client) *slidingLogLimiter

func NewSlidingLog

func NewSlidingLog(limit int64, w time.Duration, client *redis.Client, opts ...Option) *slidingLog

Types

type MockSlidingLog

type MockSlidingLog struct {
	// contains filtered or unexported fields
}

MockSlidingLog is a mock of SlidingLog interface.

func NewMockSlidingLog

func NewMockSlidingLog(ctrl *gomock.Controller) *MockSlidingLog

NewMockSlidingLog creates a new mock instance.

func (*MockSlidingLog) Allow

func (m *MockSlidingLog) Allow(ctx context.Context, key string) (bool, error)

Allow mocks base method.

func (*MockSlidingLog) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSlidingLog) SetLimit

func (m *MockSlidingLog) SetLimit(limit int64)

SetLimit mocks base method.

func (*MockSlidingLog) SetWindow

func (m *MockSlidingLog) SetWindow(w time.Duration)

SetWindow mocks base method.

type MockSlidingLogMockRecorder

type MockSlidingLogMockRecorder struct {
	// contains filtered or unexported fields
}

MockSlidingLogMockRecorder is the mock recorder for MockSlidingLog.

func (*MockSlidingLogMockRecorder) Allow

func (mr *MockSlidingLogMockRecorder) Allow(ctx, key interface{}) *gomock.Call

Allow indicates an expected call of Allow.

func (*MockSlidingLogMockRecorder) SetLimit

func (mr *MockSlidingLogMockRecorder) SetLimit(limit interface{}) *gomock.Call

SetLimit indicates an expected call of SetLimit.

func (*MockSlidingLogMockRecorder) SetWindow

func (mr *MockSlidingLogMockRecorder) SetWindow(w interface{}) *gomock.Call

SetWindow indicates an expected call of SetWindow.

type Option

type Option func(o *option)

func WithClock

func WithClock(clock clock.Clock) Option

type SlidingLog

type SlidingLog interface {
	Allow(ctx context.Context, key string) (bool, error)
	SetLimit(limit int64)
	SetWindow(w time.Duration)
}

Jump to

Keyboard shortcuts

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