limiter

package
v0.0.0-...-6f4a9a0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

go:generate mockgen -source issuer.go -destination mock_issuer.go -package issuer

Package limiter is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter interface {
	Visit(key string) (Record, error)
}

func New

func New(max, ttl int) Limiter

type MockLimiter

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

MockLimiter is a mock of Limiter interface

func NewMockLimiter

func NewMockLimiter(ctrl *gomock.Controller) *MockLimiter

NewMockLimiter creates a new mock instance

func (*MockLimiter) EXPECT

func (m *MockLimiter) EXPECT() *MockLimiterMockRecorder

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

func (*MockLimiter) Visit

func (m *MockLimiter) Visit(key string) (Record, error)

Visit mocks base method

type MockLimiterMockRecorder

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

MockLimiterMockRecorder is the mock recorder for MockLimiter

func (*MockLimiterMockRecorder) Visit

func (mr *MockLimiterMockRecorder) Visit(key interface{}) *gomock.Call

Visit indicates an expected call of Visit

type Record

type Record struct {
	Count     int
	Remaining int
	ResetAt   int
}

Jump to

Keyboard shortcuts

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