main bac21c6

mock_rate_limiter.go RawHistoryFolder

1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8	"context"
9
10	mock "github.com/stretchr/testify/mock"
11)
12
13// NewMockRateLimiter creates a new instance of MockRateLimiter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
14// The first argument is typically a *testing.T value.
15func NewMockRateLimiter(t interface {
16	mock.TestingT
17	Cleanup(func())
18}) *MockRateLimiter {
19	if helper, ok := t.(interface{ Helper() }); ok {
20		helper.Helper()
21	}
22
23	mock := &MockRateLimiter{}
24	mock.Mock.Test(t)
25
26	t.Cleanup(func() {
27		if helper, ok := t.(interface{ Helper() }); ok {
28			helper.Helper()
29		}
30		mock.AssertExpectations(t)
31	})
32
33	return mock
34}
35
36// MockRateLimiter is an autogenerated mock type for the RateLimiter type
37type MockRateLimiter struct {
38	mock.Mock
39}
40
41type MockRateLimiter_Expecter struct {
42	mock *mock.Mock
43}
44
45func (_m *MockRateLimiter) EXPECT() *MockRateLimiter_Expecter {
46	return &MockRateLimiter_Expecter{mock: &_m.Mock}
47}
48
49// Allow provides a mock function for the type MockRateLimiter
50func (_mock *MockRateLimiter) Allow(ctx context.Context, key string) bool {
51	ret := _mock.Called(ctx, key)
52
53	if len(ret) == 0 {
54		panic("no return value specified for Allow")
55	}
56
57	var r0 bool
58	if returnFunc, ok := ret.Get(0).(func(context.Context, string) bool); ok {
59		r0 = returnFunc(ctx, key)
60	} else {
61		r0 = ret.Get(0).(bool)
62	}
63	return r0
64}
65
66// MockRateLimiter_Allow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Allow'
67type MockRateLimiter_Allow_Call struct {
68	*mock.Call
69}
70
71// Allow is a helper method to define mock.On call
72//   - ctx context.Context
73//   - key string
74func (_e *MockRateLimiter_Expecter) Allow(ctx any, key any) *MockRateLimiter_Allow_Call {
75	return &MockRateLimiter_Allow_Call{Call: _e.mock.On("Allow", ctx, key)}
76}
77
78func (_c *MockRateLimiter_Allow_Call) Run(run func(ctx context.Context, key string)) *MockRateLimiter_Allow_Call {
79	_c.Call.Run(func(args mock.Arguments) {
80		var arg0 context.Context
81		if args[0] != nil {
82			arg0 = args[0].(context.Context)
83		}
84		var arg1 string
85		if args[1] != nil {
86			arg1 = args[1].(string)
87		}
88		run(
89			arg0,
90			arg1,
91		)
92	})
93	return _c
94}
95
96func (_c *MockRateLimiter_Allow_Call) Return(b bool) *MockRateLimiter_Allow_Call {
97	_c.Call.Return(b)
98	return _c
99}
100
101func (_c *MockRateLimiter_Allow_Call) RunAndReturn(run func(ctx context.Context, key string) bool) *MockRateLimiter_Allow_Call {
102	_c.Call.Return(run)
103	return _c
104}
105
106// AllowN provides a mock function for the type MockRateLimiter
107func (_mock *MockRateLimiter) AllowN(ctx context.Context, key string, n int) bool {
108	ret := _mock.Called(ctx, key, n)
109
110	if len(ret) == 0 {
111		panic("no return value specified for AllowN")
112	}
113
114	var r0 bool
115	if returnFunc, ok := ret.Get(0).(func(context.Context, string, int) bool); ok {
116		r0 = returnFunc(ctx, key, n)
117	} else {
118		r0 = ret.Get(0).(bool)
119	}
120	return r0
121}
122
123// MockRateLimiter_AllowN_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllowN'
124type MockRateLimiter_AllowN_Call struct {
125	*mock.Call
126}
127
128// AllowN is a helper method to define mock.On call
129//   - ctx context.Context
130//   - key string
131//   - n int
132func (_e *MockRateLimiter_Expecter) AllowN(ctx any, key any, n any) *MockRateLimiter_AllowN_Call {
133	return &MockRateLimiter_AllowN_Call{Call: _e.mock.On("AllowN", ctx, key, n)}
134}
135
136func (_c *MockRateLimiter_AllowN_Call) Run(run func(ctx context.Context, key string, n int)) *MockRateLimiter_AllowN_Call {
137	_c.Call.Run(func(args mock.Arguments) {
138		var arg0 context.Context
139		if args[0] != nil {
140			arg0 = args[0].(context.Context)
141		}
142		var arg1 string
143		if args[1] != nil {
144			arg1 = args[1].(string)
145		}
146		var arg2 int
147		if args[2] != nil {
148			arg2 = args[2].(int)
149		}
150		run(
151			arg0,
152			arg1,
153			arg2,
154		)
155	})
156	return _c
157}
158
159func (_c *MockRateLimiter_AllowN_Call) Return(b bool) *MockRateLimiter_AllowN_Call {
160	_c.Call.Return(b)
161	return _c
162}
163
164func (_c *MockRateLimiter_AllowN_Call) RunAndReturn(run func(ctx context.Context, key string, n int) bool) *MockRateLimiter_AllowN_Call {
165	_c.Call.Return(run)
166	return _c
167}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 106

↑↓ moveenter openesc close