/
token_repository.go
52 lines (38 loc) · 1.12 KB
/
token_repository.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
package mocks
import (
"context"
"github.com/stretchr/testify/mock"
"time"
)
// ... imports omitted
// MockTokenRepository is a mock type for model.TokenRepository
type MockTokenRepository struct {
mock.Mock
}
// SetRefreshToken is a mock of model.TokenRepository SetRefreshToken
func (m *MockTokenRepository) SetRefreshToken(ctx context.Context, userID string, tokenID string, expiresIn time.Duration) error {
ret := m.Called(ctx, userID, tokenID, expiresIn)
var r0 error
if ret.Get(0) != nil {
r0 = ret.Get(0).(error)
}
return r0
}
// DeleteRefreshToken is a mock of model.TokenRepository DeleteRefreshToken
func (m *MockTokenRepository) DeleteRefreshToken(ctx context.Context, userID string, prevTokenID string) error {
ret := m.Called(ctx, userID, prevTokenID)
var r0 error
if ret.Get(0) != nil {
r0 = ret.Get(0).(error)
}
return r0
}
// DeleteUserRefreshToken mocks concrete DeleteUserRefreshToken
func (m *MockTokenRepository) DeleteUserRefreshToken(ctx context.Context, userID string) error {
ret := m.Called(ctx, userID)
var r0 error
if ret.Get(0) != nil {
r0 = ret.Get(0).(error)
}
return r0
}