-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
38 lines (31 loc) · 959 Bytes
/
api.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
package v1beta5
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"theia-workspace-garbage-collector/api/types/v1beta5"
)
type V1Beta5Interface interface {
Workspace(namespace string) WorkspaceInterface
}
type V1Beta5Client struct {
restClient rest.Interface
}
func NewForConfig(c *rest.Config) (*V1Beta5Client, error) {
config := *c
config.ContentConfig.GroupVersion = &schema.GroupVersion{Group: v1beta5.GroupName, Version: v1beta5.GroupVersion}
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.UserAgent = rest.DefaultKubernetesUserAgent()
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &V1Beta5Client{restClient: client}, nil
}
func (c *V1Beta5Client) Workspaces(namespace string) WorkspaceInterface {
return &workspaceClient{
restClient: c.restClient,
ns: namespace,
}
}