Documentation
¶
Overview ¶
设置空间的跨域规则
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 (*CORSRule) UnmarshalJSON ¶
type Request ¶
type Request struct {
Bucket string // 指定空间名称
Credentials credentials.CredentialsProvider // 鉴权参数,用于生成鉴权凭证,如果为空,则使用 HTTPClientOptions 中的 CredentialsProvider
CORSRules CORSRules // 跨域规则列表
}
调用 API 所用的请求
func (*Request) MarshalJSON ¶
func (*Request) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.