Skip to main content

cos

Tencent Cloud Object Storage

Project#

https://github.com/beyondstorage/go-service-cos

Config#

Servicer#

Available Pairs#

NameRequiredComments
credentialYonly support hmac protocol

Examples#

Init servicer (see this page for details)

import (    _ "github.com/beyondstorage/go-service-cos/v3"    "github.com/beyondstorage/go-storage/v4/services")
srv, err := services.NewServicerFromString("cos://?credential=hmac:<account_name>:<account_key>")if err != nil {    log.Fatalf("cos new service: %v", err)}

Storager#

Available Pairs#

NameRequiredComments
nameYbucket name
work_dirNwork dir
locationYlocation

Examples#

Init storager (see this page for details)

import (    _ "github.com/beyondstorage/go-service-cos/v3"    "github.com/beyondstorage/go-storage/v4/services")
store, err := services.NewStoragerFromString("cos://<container_name>/<work_dir>?credential=hmac:<account_name>:<account_key>&location=<bucket_location>")if err != nil {    log.Fatalf("cos new service: %v", err)}

Implementation#

This service implements following interfaces:

Pairs#

Server-Side Encryption (SSE)#

COS supports three options for Server-Side Encryption:

  • Server-Side Encryption with COS-Managed Keys (SSE-COS)
  • Server-Side Encryption with Customer Master Keys (CMKs) Stored in Key Management Service (SSE-KMS)
  • Server-Side Encryption with Customer-Provided Keys (SSE-C)

Refer to https://cloud.tencent.com/document/product/436/18145 for more details.

SSE-COS#

NameComments
server-side-encryptionthe encryption algorithm. It should be AES256 .
Supported Operations#

SSE-KMS#

NameComments
server-side-encryptionthe server-side encryption algorithm used. It should be cos/kms .
server-side-encryption-cos-kms-key-idspecify the ID of the customer managed CMK used to protect the data
server-side-encryption-contextan optional set of key-value pairs that can contain additional contextual information about the data. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
Supported Operations#

SSE-C#

Server-Side Encryption with Customer-Provided Keys

NameComments
server-side-encryption-customer-algorithmUse this header to specify the encryption algorithm. The header value must be "AES256".
server-side-encryption-customer-keya 32-byte customer-provided AES256 key
Supported Operations#