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
/
Copy pathrepository.go
68 lines (56 loc) · 2.06 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
package mocks
import (
"github.com/lyft/flyteadmin/pkg/repositories"
"github.com/lyft/flyteadmin/pkg/repositories/interfaces"
)
type MockRepository struct {
taskRepo interfaces.TaskRepoInterface
workflowRepo interfaces.WorkflowRepoInterface
launchPlanRepo interfaces.LaunchPlanRepoInterface
executionRepo interfaces.ExecutionRepoInterface
nodeExecutionRepo interfaces.NodeExecutionRepoInterface
projectRepo interfaces.ProjectRepoInterface
projectDomainRepo interfaces.ProjectDomainRepoInterface
taskExecutionRepo interfaces.TaskExecutionRepoInterface
namedEntityRepo interfaces.NamedEntityRepoInterface
}
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) NodeExecutionRepo() interfaces.NodeExecutionRepoInterface {
return r.nodeExecutionRepo
}
func (r *MockRepository) ProjectRepo() interfaces.ProjectRepoInterface {
return r.projectRepo
}
func (r *MockRepository) ProjectDomainRepo() interfaces.ProjectDomainRepoInterface {
return r.projectDomainRepo
}
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(),
projectDomainRepo: NewMockProjectDomainRepo(),
taskExecutionRepo: NewMockTaskExecutionRepo(),
namedEntityRepo: NewMockNamedEntityRepo(),
}
}