This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
/
repository.go
94 lines (78 loc) · 3.48 KB
/
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
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
package mocks
import (
"github.com/flyteorg/flyteadmin/pkg/repositories"
"github.com/flyteorg/flyteadmin/pkg/repositories/interfaces"
sIface "github.com/flyteorg/flyteadmin/scheduler/repositories/interfaces"
sMocks "github.com/flyteorg/flyteadmin/scheduler/repositories/mocks"
)
type MockRepository struct {
taskRepo interfaces.TaskRepoInterface
workflowRepo interfaces.WorkflowRepoInterface
launchPlanRepo interfaces.LaunchPlanRepoInterface
executionRepo interfaces.ExecutionRepoInterface
ExecutionEventRepoIface interfaces.ExecutionEventRepoInterface
nodeExecutionRepo interfaces.NodeExecutionRepoInterface
NodeExecutionEventRepoIface interfaces.NodeExecutionEventRepoInterface
projectRepo interfaces.ProjectRepoInterface
resourceRepo interfaces.ResourceRepoInterface
taskExecutionRepo interfaces.TaskExecutionRepoInterface
namedEntityRepo interfaces.NamedEntityRepoInterface
schedulableEntityRepo sIface.SchedulableEntityRepoInterface
schedulableEntitySnapshotRepo sIface.ScheduleEntitiesSnapShotRepoInterface
}
func (r *MockRepository) SchedulableEntityRepo() sIface.SchedulableEntityRepoInterface {
return r.schedulableEntityRepo
}
func (r *MockRepository) ScheduleEntitiesSnapshotRepo() sIface.ScheduleEntitiesSnapShotRepoInterface {
return r.schedulableEntitySnapshotRepo
}
func (r *MockRepository) TaskRepo() interfaces.TaskRepoInterface {
return r.taskRepo
}
func (r *MockRepository) WorkflowRepo() interfaces.WorkflowRepoInterface {
return r.workflowRepo
}
func (r *MockRepository) LaunchPlanRepo() interfaces.LaunchPlanRepoInterface {
return r.launchPlanRepo
}
func (r *MockRepository) ExecutionRepo() interfaces.ExecutionRepoInterface {
return r.executionRepo
}
func (r *MockRepository) ExecutionEventRepo() interfaces.ExecutionEventRepoInterface {
return r.ExecutionEventRepoIface
}
func (r *MockRepository) NodeExecutionRepo() interfaces.NodeExecutionRepoInterface {
return r.nodeExecutionRepo
}
func (r *MockRepository) NodeExecutionEventRepo() interfaces.NodeExecutionEventRepoInterface {
return r.NodeExecutionEventRepoIface
}
func (r *MockRepository) ProjectRepo() interfaces.ProjectRepoInterface {
return r.projectRepo
}
func (r *MockRepository) ResourceRepo() interfaces.ResourceRepoInterface {
return r.resourceRepo
}
func (r *MockRepository) TaskExecutionRepo() interfaces.TaskExecutionRepoInterface {
return r.taskExecutionRepo
}
func (r *MockRepository) NamedEntityRepo() interfaces.NamedEntityRepoInterface {
return r.namedEntityRepo
}
func NewMockRepository() repositories.RepositoryInterface {
return &MockRepository{
taskRepo: NewMockTaskRepo(),
workflowRepo: NewMockWorkflowRepo(),
launchPlanRepo: NewMockLaunchPlanRepo(),
executionRepo: NewMockExecutionRepo(),
nodeExecutionRepo: NewMockNodeExecutionRepo(),
projectRepo: NewMockProjectRepo(),
resourceRepo: NewMockResourceRepo(),
taskExecutionRepo: NewMockTaskExecutionRepo(),
namedEntityRepo: NewMockNamedEntityRepo(),
ExecutionEventRepoIface: &ExecutionEventRepoInterface{},
NodeExecutionEventRepoIface: &NodeExecutionEventRepoInterface{},
schedulableEntityRepo: &sMocks.SchedulableEntityRepoInterface{},
schedulableEntitySnapshotRepo: &sMocks.ScheduleEntitiesSnapShotRepoInterface{},
}
}