|
@@ -1,22 +1,28 @@
|
|
|
package sample
|
|
package sample
|
|
|
|
|
|
|
|
-const (
|
|
|
|
|
|
|
+import "os"
|
|
|
|
|
+
|
|
|
|
|
+var (
|
|
|
// Sample code's env configuration. You need to specify them with the actual configuration if you want to run sample code
|
|
// Sample code's env configuration. You need to specify them with the actual configuration if you want to run sample code
|
|
|
- endpoint string = "<endpoint>"
|
|
|
|
|
- accessID string = "<AccessKeyId>"
|
|
|
|
|
- accessKey string = "<AccessKeySecret>"
|
|
|
|
|
- bucketName string = "<my-bucket>"
|
|
|
|
|
- kmsID string = "<KmsID>"
|
|
|
|
|
|
|
+ endpoint = os.Getenv("OSS_TEST_ENDPOINT")
|
|
|
|
|
+ accessID = os.Getenv("OSS_TEST_ACCESS_KEY_ID")
|
|
|
|
|
+ accessKey = os.Getenv("OSS_TEST_ACCESS_KEY_SECRET")
|
|
|
|
|
+ bucketName = os.Getenv("OSS_TEST_BUCKET")
|
|
|
|
|
+ kmsID = os.Getenv("OSS_TEST_KMS_ID")
|
|
|
|
|
|
|
|
// The cname endpoint
|
|
// The cname endpoint
|
|
|
// These information are required to run sample/cname_sample
|
|
// These information are required to run sample/cname_sample
|
|
|
- endpoint4Cname string = "<endpoint>"
|
|
|
|
|
- accessID4Cname string = "<AccessKeyId>"
|
|
|
|
|
- accessKey4Cname string = "<AccessKeySecret>"
|
|
|
|
|
- bucketName4Cname string = "<my-cname-bucket>"
|
|
|
|
|
|
|
+ endpoint4Cname = os.Getenv("OSS_TEST_ENDPOINT")
|
|
|
|
|
+ accessID4Cname = os.Getenv("OSS_TEST_ACCESS_KEY_ID")
|
|
|
|
|
+ accessKey4Cname = os.Getenv("OSS_TEST_ACCESS_KEY_SECRET")
|
|
|
|
|
+ bucketName4Cname = os.Getenv("OSS_TEST_CNAME_BUCKET")
|
|
|
|
|
+)
|
|
|
|
|
+
|
|
|
|
|
+const (
|
|
|
|
|
|
|
|
// The object name in the sample code
|
|
// The object name in the sample code
|
|
|
- objectKey string = "my-object"
|
|
|
|
|
|
|
+ objectKey string = "my-object"
|
|
|
|
|
+ objectAppendKey string = "my-object-append"
|
|
|
|
|
|
|
|
// The local files to run sample code.
|
|
// The local files to run sample code.
|
|
|
localFile string = "src/sample/BingWallpaper-2015-11-07.jpg"
|
|
localFile string = "src/sample/BingWallpaper-2015-11-07.jpg"
|