packer-cn/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go/sdk/connection.go

22 lines
399 B
Go
Raw Normal View History

2018-01-11 05:41:47 -05:00
package sdk
import (
"os"
)
// NewConnection create connection for server api
func NewConnection(accessKey string, secretKey string) *Conn {
conn := &Conn{
accessKey: accessKey,
secretKey: secretKey,
apiURL: "https://api.ncloud.com/",
}
// for other phase(dev, test, beta ...) test
if os.Getenv("NCLOUD_API_GW") != "" {
conn.apiURL = os.Getenv("NCLOUD_API_GW")
}
return conn
}