-
Notifications
You must be signed in to change notification settings - Fork 43
/
quota.go
176 lines (150 loc) · 6.26 KB
/
quota.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/baetyl/baetyl-cloud/v2/service (interfaces: QuotaService)
// Package service is a generated GoMock package.
package service
import (
plugin "github.com/baetyl/baetyl-cloud/v2/plugin"
gomock "github.com/golang/mock/gomock"
reflect "reflect"
)
// MockQuotaService is a mock of QuotaService interface
type MockQuotaService struct {
ctrl *gomock.Controller
recorder *MockQuotaServiceMockRecorder
}
// MockQuotaServiceMockRecorder is the mock recorder for MockQuotaService
type MockQuotaServiceMockRecorder struct {
mock *MockQuotaService
}
// NewMockQuotaService creates a new mock instance
func NewMockQuotaService(ctrl *gomock.Controller) *MockQuotaService {
mock := &MockQuotaService{ctrl: ctrl}
mock.recorder = &MockQuotaServiceMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockQuotaService) EXPECT() *MockQuotaServiceMockRecorder {
return m.recorder
}
// AcquireQuota mocks base method
func (m *MockQuotaService) AcquireQuota(arg0, arg1 string, arg2 int) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AcquireQuota", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// AcquireQuota indicates an expected call of AcquireQuota
func (mr *MockQuotaServiceMockRecorder) AcquireQuota(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcquireQuota", reflect.TypeOf((*MockQuotaService)(nil).AcquireQuota), arg0, arg1, arg2)
}
// CheckQuota mocks base method
func (m *MockQuotaService) CheckQuota(arg0 string, arg1 plugin.QuotaCollector) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CheckQuota", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// CheckQuota indicates an expected call of CheckQuota
func (mr *MockQuotaServiceMockRecorder) CheckQuota(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckQuota", reflect.TypeOf((*MockQuotaService)(nil).CheckQuota), arg0, arg1)
}
// Close mocks base method
func (m *MockQuotaService) Close() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error)
return ret0
}
// Close indicates an expected call of Close
func (mr *MockQuotaServiceMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockQuotaService)(nil).Close))
}
// CreateQuota mocks base method
func (m *MockQuotaService) CreateQuota(arg0 string, arg1 map[string]int) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateQuota", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// CreateQuota indicates an expected call of CreateQuota
func (mr *MockQuotaServiceMockRecorder) CreateQuota(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateQuota", reflect.TypeOf((*MockQuotaService)(nil).CreateQuota), arg0, arg1)
}
// DeleteQuota mocks base method
func (m *MockQuotaService) DeleteQuota(arg0, arg1 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteQuota", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteQuota indicates an expected call of DeleteQuota
func (mr *MockQuotaServiceMockRecorder) DeleteQuota(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteQuota", reflect.TypeOf((*MockQuotaService)(nil).DeleteQuota), arg0, arg1)
}
// DeleteQuotaByNamespace mocks base method
func (m *MockQuotaService) DeleteQuotaByNamespace(arg0 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteQuotaByNamespace", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// DeleteQuotaByNamespace indicates an expected call of DeleteQuotaByNamespace
func (mr *MockQuotaServiceMockRecorder) DeleteQuotaByNamespace(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteQuotaByNamespace", reflect.TypeOf((*MockQuotaService)(nil).DeleteQuotaByNamespace), arg0)
}
// GetDefaultQuotas mocks base method
func (m *MockQuotaService) GetDefaultQuotas(arg0 string) (map[string]int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetDefaultQuotas", arg0)
ret0, _ := ret[0].(map[string]int)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetDefaultQuotas indicates an expected call of GetDefaultQuotas
func (mr *MockQuotaServiceMockRecorder) GetDefaultQuotas(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultQuotas", reflect.TypeOf((*MockQuotaService)(nil).GetDefaultQuotas), arg0)
}
// GetQuota mocks base method
func (m *MockQuotaService) GetQuota(arg0 string) (map[string]int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetQuota", arg0)
ret0, _ := ret[0].(map[string]int)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetQuota indicates an expected call of GetQuota
func (mr *MockQuotaServiceMockRecorder) GetQuota(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQuota", reflect.TypeOf((*MockQuotaService)(nil).GetQuota), arg0)
}
// ReleaseQuota mocks base method
func (m *MockQuotaService) ReleaseQuota(arg0, arg1 string, arg2 int) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ReleaseQuota", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// ReleaseQuota indicates an expected call of ReleaseQuota
func (mr *MockQuotaServiceMockRecorder) ReleaseQuota(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReleaseQuota", reflect.TypeOf((*MockQuotaService)(nil).ReleaseQuota), arg0, arg1, arg2)
}
// UpdateQuota mocks base method
func (m *MockQuotaService) UpdateQuota(arg0, arg1 string, arg2 int) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateQuota", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateQuota indicates an expected call of UpdateQuota
func (mr *MockQuotaServiceMockRecorder) UpdateQuota(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateQuota", reflect.TypeOf((*MockQuotaService)(nil).UpdateQuota), arg0, arg1, arg2)
}