config.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package sample
  2. import "os"
  3. var (
  4. // Sample code's env configuration. You need to specify them with the actual configuration if you want to run sample code
  5. endpoint = os.Getenv("OSS_TEST_ENDPOINT")
  6. accessID = os.Getenv("OSS_TEST_ACCESS_KEY_ID")
  7. accessKey = os.Getenv("OSS_TEST_ACCESS_KEY_SECRET")
  8. bucketName = os.Getenv("OSS_TEST_BUCKET")
  9. kmsID = os.Getenv("OSS_TEST_KMS_ID")
  10. accountID = os.Getenv("OSS_TEST_ACCOUNT_ID")
  11. stsARN = os.Getenv("OSS_TEST_STS_ARN")
  12. // Credential
  13. credentialAccessID = os.Getenv("OSS_CREDENTIAL_KEY_ID")
  14. credentialAccessKey = os.Getenv("OSS_CREDENTIAL_KEY_SECRET")
  15. credentialUID = os.Getenv("OSS_CREDENTIAL_UID")
  16. // The cname endpoint
  17. endpoint4Cname = os.Getenv("OSS_TEST_CNAME_ENDPOINT")
  18. )
  19. const (
  20. // The object name in the sample code
  21. objectKey string = "my-object"
  22. appendObjectKey string = "my-object-append"
  23. // The local files to run sample code.
  24. localFile string = "sample/BingWallpaper-2015-11-07.jpg"
  25. localCsvFile string = "sample/sample_data.csv"
  26. localJSONFile string = "sample/sample_json.json"
  27. localJSONLinesFile string = "sample/sample_json_lines.json"
  28. htmlLocalFile string = "sample/The Go Programming Language.html"
  29. )