-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserRepository.go
96 lines (75 loc) · 2.35 KB
/
UserRepository.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
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
time "time"
)
// UserRepository is an autogenerated mock type for the UserRepository type
type UserRepository struct {
mock.Mock
}
// DecrementUsage provides a mock function with given fields: ctx, userID, usage
func (_m *UserRepository) DecrementUsage(ctx context.Context, userID string, usage int64) error {
ret := _m.Called(ctx, userID, usage)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, int64) error); ok {
r0 = rf(ctx, userID, usage)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetUserRateLimit provides a mock function with given fields: ctx, userID
func (_m *UserRepository) GetUserRateLimit(ctx context.Context, userID string) (int, error) {
ret := _m.Called(ctx, userID)
var r0 int
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (int, error)); ok {
return rf(ctx, userID)
}
if rf, ok := ret.Get(0).(func(context.Context, string) int); ok {
r0 = rf(ctx, userID)
} else {
r0 = ret.Get(0).(int)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, userID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IncrementUsage provides a mock function with given fields: ctx, userID, usage
func (_m *UserRepository) IncrementUsage(ctx context.Context, userID string, usage int64) error {
ret := _m.Called(ctx, userID, usage)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, int64) error); ok {
r0 = rf(ctx, userID, usage)
} else {
r0 = ret.Error(0)
}
return r0
}
// ResetUsage provides a mock function with given fields: ctx, end
func (_m *UserRepository) ResetUsage(ctx context.Context, end time.Time) error {
ret := _m.Called(ctx, end)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, time.Time) error); ok {
r0 = rf(ctx, end)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewUserRepository creates a new instance of UserRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewUserRepository(t interface {
mock.TestingT
Cleanup(func())
}) *UserRepository {
mock := &UserRepository{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}