本文整理匯總了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})
}