13 Star 51 Fork 0

Gitee 极速下载/etcd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/coreos/etcd
克隆/下载
context.go 918 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ben Johnson 提交于 2014-03-24 15:09 . bump(github.com/goraft/raft): 6bf34b9
package raft
// Context represents the current state of the server. It is passed into
// a command when the command is being applied since the server methods
// are locked.
type Context interface {
Server() Server
CurrentTerm() uint64
CurrentIndex() uint64
CommitIndex() uint64
}
// context is the concrete implementation of Context.
type context struct {
server Server
currentIndex uint64
currentTerm uint64
commitIndex uint64
}
// Server returns a reference to the server.
func (c *context) Server() Server {
return c.server
}
// CurrentTerm returns current term the server is in.
func (c *context) CurrentTerm() uint64 {
return c.currentTerm
}
// CurrentIndex returns current index the server is at.
func (c *context) CurrentIndex() uint64 {
return c.currentIndex
}
// CommitIndex returns last commit index the server is at.
func (c *context) CommitIndex() uint64 {
return c.commitIndex
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mirrors/etcd.git
git@gitee.com:mirrors/etcd.git
mirrors
etcd
etcd
v0.4.5

搜索帮助

0d507c66 1850385 C8b1a773 1850385