Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
github.com/mozillazg/go-cos
腾讯云对象存储服务 COS(Cloud Object Storage) Go SDK(API 版本:V5 版本的 XML API)。
go get -u github.com/mozillazg/go-cos
推荐使用 go mod 之类的技术指定使用的 go-cos 包版本号。
package main
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"github.com/mozillazg/go-cos"
)
func main() {
b, _ := cos.NewBaseURL("https://<bucket>-<appid>.cos.<region>.myqcloud.com")
c := cos.NewClient(b, &http.Client{
Transport: &cos.AuthorizationTransport{
SecretID: os.Getenv("COS_SECRETID"),
SecretKey: os.Getenv("COS_SECRETKEY"),
},
})
name := "test/hello.txt"
resp, err := c.Object.Get(context.Background(), name, nil)
if err != nil {
panic(err)
}
defer resp.Body.Close()
bs, _ := ioutil.ReadAll(resp.Body)
fmt.Printf("%s\n", string(bs))
}
备注:
http.Client
的 Timeout
字段或者
Transport
字段之类的)或在需要时实现所需的超时机制(比如,通过 context
包实现)。debug
包只是调试用的不是必需的依赖)。Service API:
Bucket API:
Object API:
其他功能:
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.