/
core.go
41 lines (32 loc) · 1.14 KB
/
core.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
package rest
import (
"github.com/Aptomi/aptomi/pkg/client"
"github.com/Aptomi/aptomi/pkg/client/rest/http"
"github.com/Aptomi/aptomi/pkg/config"
)
type coreClient struct {
cfg *config.Client
httpClient http.Client
}
// New returns new instance of the Core API client http rest implementation
func New(cfg *config.Client, httpClient http.Client) client.Core {
return &coreClient{cfg: cfg, httpClient: httpClient}
}
func (client *coreClient) Policy() client.Policy {
return &policyClient{cfg: client.cfg, httpClient: client.httpClient}
}
func (client *coreClient) Claim() client.Claim {
return &claimClient{cfg: client.cfg, httpClient: client.httpClient}
}
func (client *coreClient) Revision() client.Revision {
return &revisionClient{cfg: client.cfg, httpClient: client.httpClient}
}
func (client *coreClient) State() client.State {
return &stateClient{cfg: client.cfg, httpClient: client.httpClient}
}
func (client *coreClient) User() client.User {
return &userClient{cfg: client.cfg, httpClient: client.httpClient}
}
func (client *coreClient) Version() client.Version {
return &versionClient{cfg: client.cfg, httpClient: client.httpClient}
}