set_bucket_cors_rules

package
v7.25.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

设置空间的跨域规则

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedHeaders

type AllowedHeaders = []string

允许的 Header 列表

type AllowedMethods

type AllowedMethods = []string

允许的方法列表

type AllowedOriginHosts

type AllowedOriginHosts = []string

允许的域名列表

type CORSRule

type CORSRule struct {
	AllowedOrigin AllowedOriginHosts // 允许的域名。必填;支持通配符 * ;*表示全部匹配;只有第一个 * 生效;需要设置 "Scheme";大小写敏感
	AllowedMethod AllowedMethods     // 允许的方法。必填;不支持通配符;大小写不敏感;
	AllowedHeader AllowedHeaders
	ExposedHeader ExposedHeaders // 选填;不支持通配符;X-Log, X-Reqid 是默认会暴露的两个 header;其他的 header 如果没有设置,则不会暴露;大小写不敏感;
	MaxAge        int64          // 结果可以缓存的时间。选填;空则不缓存
}

跨域规则

func (*CORSRule) MarshalJSON

func (j *CORSRule) MarshalJSON() ([]byte, error)

func (*CORSRule) UnmarshalJSON

func (j *CORSRule) UnmarshalJSON(data []byte) error

type CORSRules

type CORSRules []CORSRule

跨域规则列表

type ExposedHeaders

type ExposedHeaders = []string

暴露的 Header 列表

type Request

type Request struct {
	Bucket      string                          // 指定空间名称
	Credentials credentials.CredentialsProvider // 鉴权参数,用于生成鉴权凭证,如果为空,则使用 HTTPClientOptions 中的 CredentialsProvider
	CORSRules   CORSRules                       // 跨域规则列表
}

调用 API 所用的请求

func (*Request) MarshalJSON

func (j *Request) MarshalJSON() ([]byte, error)

func (*Request) UnmarshalJSON

func (j *Request) UnmarshalJSON(data []byte) error

type Response

type Response struct{}

获取 API 所用的响应

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL