Debian Codegraph @

location/client.go

raw symbols SCIP
1 package location
2
3 import (
4 "os"
5
6 "github.com/denverdino/aliyungo/common"
7 )
8
9 type Client struct {
10 common.Client
11 }
12
13 const (
14 // LocationDefaultEndpoint is the default API endpoint of Location services
15 LocationDefaultEndpoint = "https://location.aliyuncs.com"
16 LocationAPIVersion = "2015-06-12"
17 )
18
19 // NewClient creates a new instance of Location client
20 func NewClient(accessKeyId, accessKeySecret string) *Client {
21 endpoint := os.Getenv("LOCATION_ENDPOINT")
22 if endpoint == "" {
23 endpoint = LocationDefaultEndpoint
24 }
25 return NewClientWithEndpoint(endpoint, accessKeyId, accessKeySecret)
26 }
27
28 func NewClientWithEndpoint(endpoint string, accessKeyId, accessKeySecret string) *Client {
29 client := &Client{}
30 client.Init(endpoint, LocationAPIVersion, accessKeyId, accessKeySecret)
31 return client
32 }