1 Star 0 Fork 0

爱薄荷的小虾米 / aws-sdk-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
customization_passes.go 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
lijunwei123 提交于 2015-06-08 15:20 . first
package api
var svcCustomizations = map[string]func(*API){
"s3": s3Customizations,
"cloudfront": cloudfrontCustomizations,
}
// customizationPasses Executes customization logic for the API by package name.
func (a *API) customizationPasses() {
if fn := svcCustomizations[a.PackageName()]; fn != nil {
fn(a)
}
}
// s3Customizations customizes the API generation to replace values specific to S3.
func s3Customizations(a *API) {
// Remove ContentMD5 members
for _, s := range a.Shapes {
if _, ok := s.MemberRefs["ContentMD5"]; ok {
delete(s.MemberRefs, "ContentMD5")
}
}
// Rename "Rule" to "LifecycleRule"
if s, ok := a.Shapes["Rule"]; ok {
s.Rename("LifecycleRule")
}
}
// cloudfrontCustomizations customized the API generation to replace values
// specific to CloudFront.
func cloudfrontCustomizations(a *API) {
// MaxItems members should always be integers
for _, s := range a.Shapes {
if ref, ok := s.MemberRefs["MaxItems"]; ok {
ref.ShapeName = "Integer"
ref.Shape = a.Shapes["Integer"]
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cqclife/aws-sdk-go.git
git@gitee.com:cqclife/aws-sdk-go.git
cqclife
aws-sdk-go
aws-sdk-go
v1.0.5

搜索帮助

344bd9b3 5694891 D2dac590 5694891