forked from servicemeshinterface/smi-controller-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.go
More file actions
30 lines (24 loc) · 633 Bytes
/
api.go
File metadata and controls
30 lines (24 loc) · 633 Bytes
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
package sdk
// API defines an object containing functions that the
// specific service meshes must implement to use this controller
type api struct {
v1alpha *v1AlphaImpl
}
var apiInstance *api
// API returns a singleton instance of the API
func API() *api {
if apiInstance == nil {
apiInstance = &api{
v1alpha: &v1AlphaImpl{},
}
}
return apiInstance
}
// register an interface which contains methods from the V1Alpha2 interface
// we register an interface to allow optional methods
func (a *api) RegisterV1Alpha(i interface{}) {
a.v1alpha.RegisterV1Alpha(i)
}
func (a *api) V1Alpha() V1Alpha {
return a.v1alpha
}