github.com/NaverCloudPlatform/ncloud-sdk-go-v2@v1.6.13/services/vnas/configuration.go (about) 1 /* 2 * vnas 3 * 4 * VPC NAS 관련 API<br/>https://ncloud.apigw.ntruss.com/vnas/v2 5 * 6 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) 7 */ 8 9 package vnas 10 11 import ( 12 "github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud" 13 "os" 14 ) 15 16 // contextKeys are used to identify the type of value in the context. 17 // Since these are string, it is possible to get a short description of the 18 // context key for logging and debugging using key.String(). 19 20 type contextKey string 21 22 func (c contextKey) String() string { 23 return "auth " + string(c) 24 } 25 26 func NewConfiguration(apiKeys ...*ncloud.APIKey) *ncloud.Configuration { 27 cfg := &ncloud.Configuration{ 28 BasePath: "https://ncloud.apigw.ntruss.com/vnas/v2", 29 DefaultHeader: make(map[string]string), 30 UserAgent: "vnas/1.0.3/go", 31 } 32 if len(apiKeys) > 0 { 33 cfg.APIKey = apiKeys[0] 34 } 35 cfg.InitCredentials() 36 if os.Getenv("NCLOUD_API_GW") != "" { 37 cfg.BasePath = os.Getenv("NCLOUD_API_GW") + "/vnas/v2" 38 } 39 return cfg 40 }