forked from rancher/go-rancher
/
generated_client.go
41 lines (33 loc) · 1.02 KB
/
generated_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
40
41
package catalog
type RancherClient struct {
RancherBaseClient
ApiVersion ApiVersionOperations
Catalog CatalogOperations
Template TemplateOperations
Question QuestionOperations
TemplateVersion TemplateVersionOperations
Error ErrorOperations
}
func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient {
client := &RancherClient{
RancherBaseClient: rancherBaseClient,
}
client.ApiVersion = newApiVersionClient(client)
client.Catalog = newCatalogClient(client)
client.Template = newTemplateClient(client)
client.Question = newQuestionClient(client)
client.TemplateVersion = newTemplateVersionClient(client)
client.Error = newErrorClient(client)
return client
}
func NewRancherClient(opts *ClientOpts) (*RancherClient, error) {
rancherBaseClient := &RancherBaseClientImpl{
Types: map[string]Schema{},
}
client := constructClient(rancherBaseClient)
err := setupRancherBaseClient(rancherBaseClient, opts)
if err != nil {
return nil, err
}
return client, nil
}