File: cache.go

package info (click to toggle)
gitlab-agent 16.1.3-2
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 6,324 kB
  • sloc: makefile: 175; sh: 52; ruby: 3
file content (62 lines) | stat: -rw-r--r-- 2,003 bytes parent folder | download
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
// Code generated by MockGen. DO NOT EDIT.
// Source: ../../cache/cache_with_err.go

// Package mock_cache is a generated GoMock package.
package mock_cache

import (
	context "context"
	reflect "reflect"
	time "time"

	gomock "github.com/golang/mock/gomock"
)

// MockErrCacher is a mock of ErrCacher interface.
type MockErrCacher[K any] struct {
	ctrl     *gomock.Controller
	recorder *MockErrCacherMockRecorder[K]
}

// MockErrCacherMockRecorder is the mock recorder for MockErrCacher.
type MockErrCacherMockRecorder[K any] struct {
	mock *MockErrCacher[K]
}

// NewMockErrCacher creates a new mock instance.
func NewMockErrCacher[K any](ctrl *gomock.Controller) *MockErrCacher[K] {
	mock := &MockErrCacher[K]{ctrl: ctrl}
	mock.recorder = &MockErrCacherMockRecorder[K]{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockErrCacher[K]) EXPECT() *MockErrCacherMockRecorder[K] {
	return m.recorder
}

// CacheError mocks base method.
func (m *MockErrCacher[K]) CacheError(ctx context.Context, key K, err error, errTtl time.Duration) {
	m.ctrl.T.Helper()
	m.ctrl.Call(m, "CacheError", ctx, key, err, errTtl)
}

// CacheError indicates an expected call of CacheError.
func (mr *MockErrCacherMockRecorder[K]) CacheError(ctx, key, err, errTtl interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CacheError", reflect.TypeOf((*MockErrCacher[K])(nil).CacheError), ctx, key, err, errTtl)
}

// GetError mocks base method.
func (m *MockErrCacher[K]) GetError(ctx context.Context, key K) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetError", ctx, key)
	ret0, _ := ret[0].(error)
	return ret0
}

// GetError indicates an expected call of GetError.
func (mr *MockErrCacherMockRecorder[K]) GetError(ctx, key interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetError", reflect.TypeOf((*MockErrCacher[K])(nil).GetError), ctx, key)
}