Skip to content

lily-lee/qcloud-cos-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qcloud-cos-go-sdk

腾讯云 COS Golang SDK (XML API)

Install & Update

# Install
go get github.com/lily-lee/qcloud-cos-go-sdk/cos

# Update
go get -u github.com/lily-lee/qcloud-cos-go-sdk/cos

Usage

package main

import (
    "github.com/lily-lee/qcloud-cos-go-sdk/cos"
    "log"
)

func main()  {
    client, err := cos.NewClient("AppID", "SecretID", "SecretKey", "https", 600)
    if err != nil {
        // Handle Error
    }
    // GetService()
    result, err := client.GetService()
    if err != nil {
        // Handle Error
    }
    log.Println("get service result:", result)
    
    bucket, err := client.NewBucket("BucketName", "Region")
    if err != nil {
        // Handle Error
    }
    
    err = bucket.PutObjectFromFile("license", "./LICENSE", nil)
    if err != nil {
        // Handle Error
    }
    
}

RoadMap

Instance

  • New Client (NewClient())
  • New Bucket (client.NewBucket())

Service

  • GET Service (client.GetService())

STS 临时密钥

  • CAM STS (client.GetSTS())

Bucket

  • DELETE Bucket (client.DeleteBucket())
  • DELETE Bucket cors (client.DeleteBucketCORS())
  • DELETE Bucket lifecycle (client.DeleteBucketLifecycle())
  • GET Bucket (client.GetBucket())
  • GET Bucket acl (client.GetBucketACL())
  • GET Bucket cors (client.GetBucketCORS())
  • GET Bucket location (client.GetBucketLocation())
  • GET Bucket lifecycle (client.GetBucketLifecycle())
  • HEAD Bucket (client.HeadBucket())
  • List Multipart Uploads (client.ListMultipartUploads())
  • PUT Bucket (client.PutBucket())
  • PUT Bucket acl (client.PutBucketACL())
  • PUT Bucket cors (client.PutBucketCORS())
  • PUT Bucket lifecycle (client.PutBucketLifecycle())

Object

  • Abort Multipart Upload (bucket.AbortMultipartUpload()
  • Complete Multipart Upload (bucket.CompleteMultipartUpload())
  • DELETE Multipart Objects (bucket.DeleteMultiObject())
  • DELETE Object (bucket.DeleteObject())
  • GET Object (bucket.GetObject())
  • GET Object to local file (bucket.GetObjectToFile())
  • GET Object acl (bucket.GetObjectACL())
  • HEAD Object (bucket.HeadObject())
  • Initiate Multipart Upload (bucket.InitiateMultipartUpload())
  • List Parts (bucket.ListParts())
  • OPTIONS Object (bucket.OptionsObject())
  • PUT Object (bucket.PutObject())
  • PUT Object from file (bucket.PutObjectFromFile())
  • PUT Object acl (bucket.PutObjectACL())
  • PUT Object - Copy (bucket.PutObjectCopy())
  • Upload Part (bucket.UploadPart())
  • Upload Part - Copy (bucket.UploadPartCopy())

参考资料

LICENSE

MIT License

About

腾讯云 COS Go SDK V5 (XML API)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages