forked from free5gc/openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.go
76 lines (60 loc) · 1.67 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Npcf_BDTPolicyControl Service API
*
* The Npcf_BDTPolicyControl Service is used by an NF service consumer to retrieve background data transfer policies from the PCF and to update the PCF with the background data transfer policy selected by the NF service consumer.
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package Npcf_BDTPolicyControl
import (
"strings"
"github.com/nycu-ucr/gonet/http"
)
type Configuration struct {
url string
basePath string
host string
defaultHeader map[string]string
userAgent string
httpClient *http.Client
}
func NewConfiguration() *Configuration {
cfg := &Configuration{
basePath: "https://example.com/npcf-bdtpolicycontrol/v1",
url: "{apiRoot}/npcf-bdtpolicycontrol/v1",
defaultHeader: make(map[string]string),
userAgent: "OpenAPI-Generator/1.0.0/go",
}
return cfg
}
func (c *Configuration) SetBasePath(apiRoot string) {
url := c.url
// Replace apiRoot
url = strings.Replace(url, "{"+"apiRoot"+"}", apiRoot, -1)
c.basePath = url
}
func (c *Configuration) BasePath() string {
return c.basePath
}
func (c *Configuration) Host() string {
return c.host
}
func (c *Configuration) SetHost(host string) {
c.host = host
}
func (c *Configuration) UserAgent() string {
return c.userAgent
}
func (c *Configuration) SetUserAgent(userAgent string) {
c.userAgent = userAgent
}
func (c *Configuration) DefaultHeader() map[string]string {
return c.defaultHeader
}
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.defaultHeader[key] = value
}
func (c *Configuration) HTTPClient() *http.Client {
return c.httpClient
}