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


Golang PutReply.Status方法代码示例

本文整理汇总了Golang中P3-f12/official/storageproto.PutReply.Status方法的典型用法代码示例。如果您正苦于以下问题:Golang PutReply.Status方法的具体用法?Golang PutReply.Status怎么用?Golang PutReply.Status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在P3-f12/official/storageproto.PutReply的用法示例。


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

示例1: RemoveFromList

// RemoveFromList
// function:
// - remove key and list value from storage
func (ss *Storageserver) RemoveFromList(args *storageproto.PutArgs, reply *storageproto.PutReply) error {
	req := &cacheReq{REMOVE_LIST_VALUE, args.Key, args.Value}
	replyc := make(chan interface{})
	ss.cacheReqC <- Request{req, replyc}
	status := (<-replyc).(bool)
	if status {
		lsplog.Vlogf(5, "Remove key successfully %s %s", args.Key, args.Value)
		reply.Status = storageproto.OK
	} else {
		lsplog.Vlogf(5, "Remove key failed %s %s", args.Key, args.Value)
		reply.Status = storageproto.EITEMNOTFOUND
	}

	return nil
}
开发者ID:TeBoring,项目名称:airline_booking,代码行数:18,代码来源:testserverimpl.go

示例2: AppendToList

// AppendToList
// function:
// - put key and list value into storage
func (ss *Storageserver) AppendToList(args *storageproto.PutArgs, reply *storageproto.PutReply) error {
	req := &cacheReq{APPEND_LIST_VALUE, args.Key, args.Value}
	replyc := make(chan interface{})
	ss.cacheReqC <- Request{req, replyc}
	status := (<-replyc).(bool)
	if status {
		lsplog.Vlogf(5, "Append key successfully %s %s", args.Key, args.Value)
		reply.Status = storageproto.OK
	} else {
		lsplog.Vlogf(5, "Append key failed %s %s", args.Key, args.Value)
		reply.Status = storageproto.EITEMEXISTS
	}

	return nil
}
开发者ID:TeBoring,项目名称:airline_booking,代码行数:18,代码来源:testserverimpl.go

示例3: Put

// Put
// function:
// - put key value into storage
func (ss *Storageserver) Put(args *storageproto.PutArgs, reply *storageproto.PutReply) error {
	req := &cacheReq{PUT_VALUE, args.Key, args.Value}
	replyc := make(chan interface{})
	ss.cacheReqC <- Request{req, replyc}
	<-replyc
	lsplog.Vlogf(5, "Put key successfully %s %s", args.Key, args.Value)
	reply.Status = storageproto.OK

	return nil
}
开发者ID:TeBoring,项目名称:airline_booking,代码行数:13,代码来源:testserverimpl.go

示例4: RemoveFromList

func (pc *ProxyCounter) RemoveFromList(args *storageproto.PutArgs, reply *storageproto.PutReply) error {
	if pc.override {
		reply.Status = pc.overrideStatus
		return pc.overrideErr
	}
	byteCount := len(args.Key) + len(args.Value)
	err := pc.srv.Call("StorageRPC.RemoveFromList", args, reply)
	atomic.AddUint32(&pc.rpcCount, 1)
	atomic.AddUint32(&pc.byteCount, uint32(byteCount))
	return err
}
开发者ID:TeBoring,项目名称:airline_booking,代码行数:11,代码来源:proxycounter.go


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