OSS(Object Storage Service)

QOR OSS provides common interface to operate files in cloud storage, ftp, filesystem etc.


Currently, QOR OSS only support file system and S3. But you can easily implement your own storage strategies by implementing the interface.

// StorageInterface define common API to operate storage
type StorageInterface interface {
  Get(path string) (*os.File, error)
  Put(path string, reader io.Reader) (*Object, error)
  Delete(path string) error
  List(path string) ([]*Object, error)
  GetEndpoint() string

Here's an example about how to use QOR OSS with S3. After initialized the s3 storage, The functions in the interface are available.

import (

func main() {
    storage := s3.New(s3.Config{AccessID: "access_id", AccessKey: "access_key", Region: "region", Bucket: "bucket", Endpoint: "cdn.getqor.com", ACL: aws.BucketCannedACLPublicRead})

    // Save a reader(io.Reader) interface into storage
    storage.Put("/sample.txt", reader)

    // Get file with path

    // Delete file with path

    // List all objects under path

    // Get the end point of current storage

results matching ""

    No results matching ""