本文整理汇总了Golang中github.com/youtube/vitess/go/bson.UnmarshalFromStream函数的典型用法代码示例。如果您正苦于以下问题:Golang UnmarshalFromStream函数的具体用法?Golang UnmarshalFromStream怎么用?Golang UnmarshalFromStream使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UnmarshalFromStream函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ReadRequestBody
// ReadRequestBody reads the body of the request
func (sc *ServerCodec) ReadRequestBody(body interface{}) error {
return bson.UnmarshalFromStream(sc.rwc, body)
}
示例2: ReadResponseBody
// ReadResponseBody reads the body of server response
func (cc *ClientCodec) ReadResponseBody(body interface{}) error {
return bson.UnmarshalFromStream(cc.rwc, body)
}
示例3: ReadRequestHeader
// ReadRequestHeader reads the header of the request
func (sc *ServerCodec) ReadRequestHeader(r *rpc.Request) error {
return bson.UnmarshalFromStream(sc.rwc, &RequestBson{r})
}
示例4: ReadResponseHeader
// ReadResponseHeader reads the header of server response
func (cc *ClientCodec) ReadResponseHeader(r *rpc.Response) error {
return bson.UnmarshalFromStream(cc.rwc, &ResponseBson{r})
}