-
Notifications
You must be signed in to change notification settings - Fork 1
/
mock_tokenbucket.go
102 lines (84 loc) · 3.14 KB
/
mock_tokenbucket.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Code generated by MockGen. DO NOT EDIT.
// Source: tokenbucket.go
package tokenbucket
import (
gomock "github.com/golang/mock/gomock"
reflect "reflect"
)
// MockConfig is a mock of Config interface
type MockConfig struct {
ctrl *gomock.Controller
recorder *MockConfigMockRecorder
}
// MockConfigMockRecorder is the mock recorder for MockConfig
type MockConfigMockRecorder struct {
mock *MockConfig
}
// NewMockConfig creates a new mock instance
func NewMockConfig(ctrl *gomock.Controller) *MockConfig {
mock := &MockConfig{ctrl: ctrl}
mock.recorder = &MockConfigMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockConfig) EXPECT() *MockConfigMockRecorder {
return m.recorder
}
// Rate mocks base method
func (m *MockConfig) Rate(chunkKey, bucketKey string) int32 {
ret := m.ctrl.Call(m, "Rate", chunkKey, bucketKey)
ret0, _ := ret[0].(int32)
return ret0
}
// Rate indicates an expected call of Rate
func (mr *MockConfigMockRecorder) Rate(chunkKey, bucketKey interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Rate", reflect.TypeOf((*MockConfig)(nil).Rate), chunkKey, bucketKey)
}
// Overflow mocks base method
func (m *MockConfig) Overflow(chunkKey, bucketKey string, tokens int32) bool {
ret := m.ctrl.Call(m, "Overflow", chunkKey, bucketKey, tokens)
ret0, _ := ret[0].(bool)
return ret0
}
// Overflow indicates an expected call of Overflow
func (mr *MockConfigMockRecorder) Overflow(chunkKey, bucketKey, tokens interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Overflow", reflect.TypeOf((*MockConfig)(nil).Overflow), chunkKey, bucketKey, tokens)
}
// MockTokenBucket is a mock of TokenBucket interface
type MockTokenBucket struct {
ctrl *gomock.Controller
recorder *MockTokenBucketMockRecorder
}
// MockTokenBucketMockRecorder is the mock recorder for MockTokenBucket
type MockTokenBucketMockRecorder struct {
mock *MockTokenBucket
}
// NewMockTokenBucket creates a new mock instance
func NewMockTokenBucket(ctrl *gomock.Controller) *MockTokenBucket {
mock := &MockTokenBucket{ctrl: ctrl}
mock.recorder = &MockTokenBucketMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockTokenBucket) EXPECT() *MockTokenBucketMockRecorder {
return m.recorder
}
// Fill mocks base method
func (m *MockTokenBucket) Fill() {
m.ctrl.Call(m, "Fill")
}
// Fill indicates an expected call of Fill
func (mr *MockTokenBucketMockRecorder) Fill() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fill", reflect.TypeOf((*MockTokenBucket)(nil).Fill))
}
// Take mocks base method
func (m *MockTokenBucket) Take(chunkKey string, bucketKeys []string) (bool, error) {
ret := m.ctrl.Call(m, "Take", chunkKey, bucketKeys)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Take indicates an expected call of Take
func (mr *MockTokenBucketMockRecorder) Take(chunkKey, bucketKeys interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Take", reflect.TypeOf((*MockTokenBucket)(nil).Take), chunkKey, bucketKeys)
}