// Replace examplebucket-1250000000 and COS_REGION with the actual information.u, _ := url.Parse("https://examplebucket-1250000000.cos.COS_REGION.myqcloud.com")// The following calls the `Get Service` API. By default, all regions (service.cos.myqcloud.com) will be queried.su, _ := url.Parse("https://cos.COS_REGION.myqcloud.com")b := &cos.BaseURL{BucketURL: u, ServiceURL: su}// 1. Permanent keyclient := cos.NewClient(b, &http.Client{Transport: &cos.AuthorizationTransport{SecretID: "SECRETID",SecretKey: "SECRETKEY",},})
// Replace examplebucket-1250000000 with the actual information.u, _ := url.Parse("https://examplebucket-1250000000.file.myqcloud.com")b := &cos.BaseURL{BucketURL: u}// Use a CDN acceleration domain. COS verification information does not need to be sent.client := cos.NewClient(b, &http.Client{})
// Set the custom CDN acceleration domain.u, _ := url.Parse("https://xxx.xxx.com")b := &cos.BaseURL{BucketURL: u}// Use a CDN acceleration domain. COS verification information does not need to be sent.client := cos.NewClient(b, &http.Client{})
// Custom origin server domainu, _ := url.Parse("https://xxx.xxx.com")b := &cos.BaseURL{BucketURL: u}client := cos.NewClient(b, &http.Client{Transport: &cos.AuthorizationTransport{SecretID: "SECRETID",SecretKey: "SECRETKEY",},})
// Global acceleration domain// Replace examplebucket-1250000000 with the actual information.u, _ := url.Parse("https://examplebucket-1250000000.cos.accelerate.myqcloud.com")b := &cos.BaseURL{BucketURL: u}client := cos.NewClient(b, &http.Client{Transport: &cos.AuthorizationTransport{SecretID: "SECRETID",SecretKey: "SECRETKEY",},})
Feedback