package
0.0.0-20201020014320-d83e2984927e
Repository: https://github.com/qorx/oss.git
Documentation: pkg.go.dev
# README
AWS S3
Usage
import "github.com/qorx/oss/aliyun"
func main() {
storage := s3.New(s3.Config{
AccessID: "access_id",
AccessKey: "access_key",
Region: "region",
Bucket: "bucket",
Endpoint: "cdn.getqor.com",
ACL: awss3.BucketCannedACLPublicRead,
})
// Save a reader interface into storage
storage.Put("/sample.txt", reader)
// Get file with path
storage.Get("/sample.txt")
// Get object as io.ReadCloser
storage.GetStream("/sample.txt")
// Delete file with path
storage.Delete("/sample.txt")
// List all objects under path
storage.List("/")
// Get Public Accessible URL (useful if current file saved privately)
storage.GetURL("/sample.txt")
}