Debian Codegraph @

cdn/client.go

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