package
0.0.0-20241126061828-4629f3a3524a
Repository: https://github.com/qor/oss.git
Documentation: pkg.go.dev

# README

AWS S3

AWS S3 backend for QOR OSS

Usage

import "github.com/qor/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")
}

# Functions

New initialize S3 storage.

# Structs

Client S3 storage.
Config S3 client config.