forked from vmware/go-vmware-nsxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.go
62 lines (52 loc) · 1.57 KB
/
configuration.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* Copyright © 2017 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: BSD-2-Clause
Generated by: https://github.com/swagger-api/swagger-codegen.git */
package nsxt
import (
"net/http"
)
const ContextOAuth2 int = 1
const ContextBasicAuth int = 2
const ContextAccessToken int = 3
const ContextAPIKey int = 4
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
type APIKey struct {
Key string
Prefix string
}
type ClientRetriesConfiguration struct {
MaxRetries int
RetryMinDelay int // milliseconds
RetryMaxDelay int // milliseconds
RetryOnStatuses []int
}
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
UserName string
Password string
RemoteAuth bool
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
ClientAuthCertFile string
ClientAuthKeyFile string
CAFile string
Insecure bool
RetriesConfiguration ClientRetriesConfiguration
HTTPClient *http.Client
}
func NewConfiguration() *Configuration {
cfg := &Configuration{
BasePath: "https://nsxmanager.your.domain/api/v1",
DefaultHeader: make(map[string]string),
UserAgent: "Swagger-Codegen/1.0.0/go",
}
return cfg
}
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}