/
interfaces.go
109 lines (88 loc) · 2.37 KB
/
interfaces.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package restore
import (
"context"
"github.com/cloudogu/k8s-backup-operator/pkg/cleanup"
appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
v12 "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"
"github.com/cloudogu/cesapp-lib/registry"
"github.com/cloudogu/k8s-backup-operator/pkg/api/ecosystem"
v1 "github.com/cloudogu/k8s-backup-operator/pkg/api/v1"
"github.com/cloudogu/k8s-backup-operator/pkg/provider"
)
type ecosystemInterface interface {
ecosystem.Interface
}
type eventRecorder interface {
record.EventRecorder
}
type controllerManager interface {
ctrl.Manager
}
type restoreManager interface {
createManager
deleteManager
}
type createManager interface {
create(ctx context.Context, restore *v1.Restore) error
}
type deleteManager interface {
delete(ctx context.Context, restore *v1.Restore) error
}
type requeueHandler interface {
Handle(ctx context.Context, contextMessage string, restore v1.RequeuableObject, originalErr error, requeueStatus string) (ctrl.Result, error)
}
type maintenanceModeSwitch interface {
// ActivateMaintenanceMode activates the maintenance mode.
ActivateMaintenanceMode(ctx context.Context, title string, text string) error
// DeactivateMaintenanceMode deactivates the maintenance mode.
DeactivateMaintenanceMode(ctx context.Context) error
}
type cesRegistry interface {
registry.Registry
}
type cleanupManager interface {
cleanup.Manager
}
// used for mocks
//nolint:unused
//goland:noinspection GoUnusedType
type ecosystemRestoreInterface interface {
ecosystem.RestoreInterface
}
//nolint:unused
//goland:noinspection GoUnusedType
type statefulSetInterface interface {
appsv1.StatefulSetInterface
}
//nolint:unused
//goland:noinspection GoUnusedType
type serviceInterface interface {
v12.ServiceInterface
}
//nolint:unused
//goland:noinspection GoUnusedType
type appsV1Interface interface {
appsv1.AppsV1Interface
}
//nolint:unused
//goland:noinspection GoUnusedType
type coreV1Interface interface {
v12.CoreV1Interface
}
//nolint:unused
//goland:noinspection GoUnusedType
type ecosystemV1Alpha1Interface interface {
ecosystem.V1Alpha1Interface
}
//nolint:unused
//goland:noinspection GoUnusedType
type configurationContext interface {
registry.ConfigurationContext
}
//nolint:unused
//goland:noinspection GoUnusedType
type restoreProvider interface {
provider.Provider
}