forked from slok/sloth
/
file_manager.go
77 lines (60 loc) 路 1.8 KB
/
file_manager.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
// Code generated by mockery v2.14.0. DO NOT EDIT.
package prometheusmock
import (
context "context"
mock "github.com/stretchr/testify/mock"
regexp "regexp"
)
// FileManager is an autogenerated mock type for the FileManager type
type FileManager struct {
mock.Mock
}
// FindFiles provides a mock function with given fields: ctx, root, matcher
func (_m *FileManager) FindFiles(ctx context.Context, root string, matcher *regexp.Regexp) ([]string, error) {
ret := _m.Called(ctx, root, matcher)
var r0 []string
if rf, ok := ret.Get(0).(func(context.Context, string, *regexp.Regexp) []string); ok {
r0 = rf(ctx, root, matcher)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, *regexp.Regexp) error); ok {
r1 = rf(ctx, root, matcher)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ReadFile provides a mock function with given fields: ctx, path
func (_m *FileManager) ReadFile(ctx context.Context, path string) ([]byte, error) {
ret := _m.Called(ctx, path)
var r0 []byte
if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
r0 = rf(ctx, path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type mockConstructorTestingTNewFileManager interface {
mock.TestingT
Cleanup(func())
}
// NewFileManager creates a new instance of FileManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewFileManager(t mockConstructorTestingTNewFileManager) *FileManager {
mock := &FileManager{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}