本文整理汇总了Golang中github.com/cockroachdb/cockroach/proto.GetResponse.Value方法的典型用法代码示例。如果您正苦于以下问题:Golang GetResponse.Value方法的具体用法?Golang GetResponse.Value怎么用?Golang GetResponse.Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cockroachdb/cockroach/proto.GetResponse
的用法示例。
在下文中一共展示了GetResponse.Value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Get
// Get returns the value for a specified key.
func (r *Range) Get(batch engine.Engine, args proto.GetRequest) (proto.GetResponse, []proto.Intent, error) {
var reply proto.GetResponse
val, intents, err := engine.MVCCGet(batch, args.Key, args.Timestamp, args.ReadConsistency == proto.CONSISTENT, args.Txn)
reply.Value = val
return reply, intents, err
}
示例2: Get
// Get returns the value for a specified key.
func (r *Range) Get(batch engine.Engine, args *proto.GetRequest, reply *proto.GetResponse) []proto.Intent {
val, intents, err := engine.MVCCGet(batch, args.Key, args.Timestamp, args.ReadConsistency == proto.CONSISTENT, args.Txn)
reply.Value = val
reply.SetGoError(err)
return intents
}
示例3: Get
// Get returns the value for a specified key.
func (r *Range) Get(args *proto.GetRequest, reply *proto.GetResponse) {
val, err := r.engine.Get(args.Key)
reply.Value = proto.Value{Bytes: val}
reply.SetGoError(err)
}
示例4: Get
// Get returns the value for a specified key.
func (r *Range) Get(args *proto.GetRequest, reply *proto.GetResponse) {
val, err := r.mvcc.Get(args.Key, args.Timestamp, args.Txn)
reply.Value = val
reply.SetGoError(err)
}