当前位置: 首页>>代码示例>>Golang>>正文


Golang Request.DataFilled方法代码示例

本文整理汇总了Golang中github.com/convox/kernel/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws.Request.DataFilled方法的典型用法代码示例。如果您正苦于以下问题:Golang Request.DataFilled方法的具体用法?Golang Request.DataFilled怎么用?Golang Request.DataFilled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/convox/kernel/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws.Request的用法示例。


在下文中一共展示了Request.DataFilled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Unmarshal

// Unmarshal unmarshals the REST component of a response in a REST service.
func Unmarshal(r *aws.Request) {
	if r.DataFilled() {
		v := reflect.Indirect(reflect.ValueOf(r.Data))
		unmarshalBody(r, v)
		unmarshalLocationElements(r, v)
	}
}
开发者ID:nguyendangminh,项目名称:kernel,代码行数:8,代码来源:unmarshal.go

示例2: verifySendMessage

func verifySendMessage(r *aws.Request) {
	if r.DataFilled() && r.ParamsFilled() {
		in := r.Params.(*SendMessageInput)
		out := r.Data.(*SendMessageOutput)
		err := checksumsMatch(in.MessageBody, out.MD5OfMessageBody)
		if err != nil {
			setChecksumError(r, err.Error())
		}
	}
}
开发者ID:nguyendangminh,项目名称:kernel,代码行数:10,代码来源:checksums.go

示例3: verifyReceiveMessage

func verifyReceiveMessage(r *aws.Request) {
	if r.DataFilled() && r.ParamsFilled() {
		ids := []string{}
		out := r.Data.(*ReceiveMessageOutput)
		for _, msg := range out.Messages {
			err := checksumsMatch(msg.Body, msg.MD5OfBody)
			if err != nil {
				ids = append(ids, *msg.MessageID)
			}
		}
		if len(ids) > 0 {
			setChecksumError(r, "invalid messages: %s", strings.Join(ids, ", "))
		}
	}
}
开发者ID:nguyendangminh,项目名称:kernel,代码行数:15,代码来源:checksums.go

示例4: buildGetBucketLocation

func buildGetBucketLocation(r *aws.Request) {
	if r.DataFilled() {
		out := r.Data.(*GetBucketLocationOutput)
		b, err := ioutil.ReadAll(r.HTTPResponse.Body)
		if err != nil {
			r.Error = apierr.New("Unmarshal", "failed reading response body", err)
			return
		}

		match := reBucketLocation.FindSubmatch(b)
		if len(match) > 1 {
			loc := string(match[1])
			out.LocationConstraint = &loc
		}
	}
}
开发者ID:nguyendangminh,项目名称:kernel,代码行数:16,代码来源:bucket_location.go

示例5: verifySendMessageBatch

func verifySendMessageBatch(r *aws.Request) {
	if r.DataFilled() && r.ParamsFilled() {
		entries := map[string]*SendMessageBatchResultEntry{}
		ids := []string{}

		out := r.Data.(*SendMessageBatchOutput)
		for _, entry := range out.Successful {
			entries[*entry.ID] = entry
		}

		in := r.Params.(*SendMessageBatchInput)
		for _, entry := range in.Entries {
			if e := entries[*entry.ID]; e != nil {
				err := checksumsMatch(entry.MessageBody, e.MD5OfMessageBody)
				if err != nil {
					ids = append(ids, *e.MessageID)
				}
			}
		}
		if len(ids) > 0 {
			setChecksumError(r, "invalid messages: %s", strings.Join(ids, ", "))
		}
	}
}
开发者ID:nguyendangminh,项目名称:kernel,代码行数:24,代码来源:checksums.go


注:本文中的github.com/convox/kernel/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws.Request.DataFilled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。