forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.go
39 lines (32 loc) · 1009 Bytes
/
client.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
package k8stest
import "github.com/influxdata/kapacitor/services/k8s/client"
type Client struct {
ScalesGetFunc func(kind, name string) (*client.Scale, error)
ScalesUpdateFunc func(kind string, scale *client.Scale) error
}
// Client returns itself.
func (c Client) Client(string) (client.Client, error) {
return c, nil
}
func (c Client) Scales(namespace string) client.ScalesInterface {
return Scales{
ScalesGetFunc: c.ScalesGetFunc,
ScalesUpdateFunc: c.ScalesUpdateFunc,
}
}
func (c Client) Versions() (client.APIVersions, error) {
return client.APIVersions{}, nil
}
func (Client) Update(client.Config) error {
return nil
}
type Scales struct {
ScalesGetFunc func(kind, name string) (*client.Scale, error)
ScalesUpdateFunc func(kind string, scale *client.Scale) error
}
func (s Scales) Get(kind, name string) (*client.Scale, error) {
return s.ScalesGetFunc(kind, name)
}
func (s Scales) Update(kind string, scale *client.Scale) error {
return s.ScalesUpdateFunc(kind, scale)
}