API | Description |
Enabling Guetzli compression | Enables the Guetzli compression feature for a bucket. |
Querying Guetzli status | Queries whether the Guetzli compression feature is enabled. |
Disabling Guetzli compression | Disables the Guetzli compression feature. |
func (s *CIService) PutGuetzli(ctx context.Context) (*Response, error)
// `CIURL` is requiredu, _ := url.Parse("https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com")cu, _ := url.Parse("http://examplebucket-1250000000.pic.ap-guangzhou.myqcloud.com")b := &cos.BaseURL{BucketURL: u, CIURL: cu}c := cos.NewClient(b, &http.Client{Transport: &cos.AuthorizationTransport{SecretID: os.Getenv("SECRETID"),SecretKey: os.Getenv("SECRETKEY"),},})_, err := c.CI.PutGuetzli(context.Background())log_status(err)
func (s *CIService) GetGuetzli(ctx context.Context) (*GetGuetzliResult, *Response, error)
// `CIURL` is requiredu, _ := url.Parse("https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com")cu, _ := url.Parse("http://examplebucket-1250000000.pic.ap-guangzhou.myqcloud.com")b := &cos.BaseURL{BucketURL: u, CIURL: cu}c := cos.NewClient(b, &http.Client{Transport: &cos.AuthorizationTransport{SecretID: os.Getenv("SECRETID"),SecretKey: os.Getenv("SECRETKEY"),},})res, _, err := c.CI.GetGuetzli(context.Background())if err == nil {fmt.Printf("%v\\n", res.GuetzliStatus)}
type GetGuetzliResult struct {GuetzliStatus string}
Node Name | Description | Type |
GuetzliStatus | Whether to enable the Guetzli compression feature: on or off | String |
func (s *CIService) DeleteGuetzli(ctx context.Context) (*Response, error)
// `CIURL` is requiredu, _ := url.Parse("https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com")cu, _ := url.Parse("http://examplebucket-1250000000.pic.ap-guangzhou.myqcloud.com")b := &cos.BaseURL{BucketURL: u, CIURL: cu}c := cos.NewClient(b, &http.Client{Transport: &cos.AuthorizationTransport{SecretID: os.Getenv("SECRETID"),SecretKey: os.Getenv("SECRETKEY"),},})_, err := c.CI.DeleteGuetzli(context.Background())
Apakah halaman ini membantu?