SYMBOL INDEX (178 symbols across 17 files) FILE: cmd/popcli/app/app.go function Execute (line 14) | func Execute() { function init (line 21) | func init() { FILE: cmd/popcli/app/cmd.go constant opPath (line 16) | opPath = "/submit" constant fetchPath (line 17) | fetchPath = "/fetch/%s" constant defaultScheme (line 18) | defaultScheme = "http://" constant tmpfile (line 19) | tmpfile = "/tmp/.popleader" function init (line 22) | func init() { type client (line 80) | type client struct method FetchKey (line 90) | func (cli *client) FetchKey(key string) (string, error) { method SetKey (line 113) | func (cli *client) SetKey(key, val string) (string, error) { method DelKey (line 117) | func (cli *client) DelKey(key string) (string, error) { method op (line 121) | func (cli *client) op(op, key, val string) (string, error) { function NewClient (line 84) | func NewClient(servers string) Client { type opResult (line 104) | type opResult struct function orChannel (line 201) | func orChannel(in ...chan interface{}) chan interface{} { FILE: cmd/popcli/app/interface.go type Client (line 3) | type Client interface FILE: cmd/popcli/client.go function main (line 10) | func main() { FILE: cmd/root.go function Execute (line 17) | func Execute() { function init (line 24) | func init() { FILE: cmd/server/server.go function init (line 12) | func init() { FILE: internal/conf/conf.go function init (line 17) | func init() { type Option (line 21) | type Option function SetConfigFile (line 23) | func SetConfigFile(file string) Option { function SetEnv (line 36) | func SetEnv() Option { type Conf (line 42) | type Conf struct function NewDefault (line 48) | func NewDefault() *Conf { function New (line 52) | func New(v *viper.Viper, opts ...Option) *Conf { function GetRaftPort (line 65) | func GetRaftPort() int { function SetDefault (line 69) | func SetDefault(key string, value interface{}) { c.SetDefault(key, value) } function Set (line 71) | func Set(key string, value interface{}) { c.Set(key, value) } function Get (line 73) | func Get(key string) interface{} { return c.Get(key) } function GetString (line 75) | func GetString(key string) string { return c.GetString(key) } function GetBool (line 77) | func GetBool(key string) bool { return c.GetBool(key) } function GetInt (line 79) | func GetInt(key string) int { return c.GetInt(key) } function GetUint32 (line 81) | func GetUint32(key string) uint32 { return c.GetUint32(key) } function GetInt32 (line 83) | func GetInt32(key string) int32 { return c.GetInt32(key) } function GetInt64 (line 85) | func GetInt64(key string) int64 { return c.GetInt64(key) } function GetFloat64 (line 87) | func GetFloat64(key string) float64 { return c.GetFloat64(key) } function GetDuration (line 89) | func GetDuration(key string) time.Duration { function BindPFlag (line 94) | func BindPFlag(key string, flag *pflag.Flag) error { return c.BindPFlag(... function InitConfig (line 97) | func InitConfig(opts ...Option) { FILE: internal/proto/raft/v1/raft.pb.go constant _ (line 20) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) constant _ (line 22) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) type RequestVoteRequest (line 26) | type RequestVoteRequest struct method Reset (line 41) | func (x *RequestVoteRequest) Reset() { method String (line 50) | func (x *RequestVoteRequest) String() string { method ProtoMessage (line 54) | func (*RequestVoteRequest) ProtoMessage() {} method ProtoReflect (line 56) | func (x *RequestVoteRequest) ProtoReflect() protoreflect.Message { method Descriptor (line 69) | func (*RequestVoteRequest) Descriptor() ([]byte, []int) { method GetTerm (line 73) | func (x *RequestVoteRequest) GetTerm() int64 { method GetCandidateId (line 80) | func (x *RequestVoteRequest) GetCandidateId() int64 { method GetLastLogIndex (line 87) | func (x *RequestVoteRequest) GetLastLogIndex() int64 { method GetLastLogTerm (line 94) | func (x *RequestVoteRequest) GetLastLogTerm() int64 { type RequestVoteResponse (line 102) | type RequestVoteResponse struct method Reset (line 113) | func (x *RequestVoteResponse) Reset() { method String (line 122) | func (x *RequestVoteResponse) String() string { method ProtoMessage (line 126) | func (*RequestVoteResponse) ProtoMessage() {} method ProtoReflect (line 128) | func (x *RequestVoteResponse) ProtoReflect() protoreflect.Message { method Descriptor (line 141) | func (*RequestVoteResponse) Descriptor() ([]byte, []int) { method GetTerm (line 145) | func (x *RequestVoteResponse) GetTerm() int64 { method GetVoteGranted (line 152) | func (x *RequestVoteResponse) GetVoteGranted() bool { type AppendEntriesRequest (line 160) | type AppendEntriesRequest struct method Reset (line 179) | func (x *AppendEntriesRequest) Reset() { method String (line 188) | func (x *AppendEntriesRequest) String() string { method ProtoMessage (line 192) | func (*AppendEntriesRequest) ProtoMessage() {} method ProtoReflect (line 194) | func (x *AppendEntriesRequest) ProtoReflect() protoreflect.Message { method Descriptor (line 207) | func (*AppendEntriesRequest) Descriptor() ([]byte, []int) { method GetTerm (line 211) | func (x *AppendEntriesRequest) GetTerm() int64 { method GetLeaderId (line 218) | func (x *AppendEntriesRequest) GetLeaderId() int64 { method GetPrevLogIndex (line 225) | func (x *AppendEntriesRequest) GetPrevLogIndex() int64 { method GetPrevLogTerm (line 232) | func (x *AppendEntriesRequest) GetPrevLogTerm() int64 { method GetEntries (line 239) | func (x *AppendEntriesRequest) GetEntries() []*LogEntry { method GetLeaderCommit (line 246) | func (x *AppendEntriesRequest) GetLeaderCommit() int64 { type LogEntry (line 254) | type LogEntry struct method Reset (line 265) | func (x *LogEntry) Reset() { method String (line 274) | func (x *LogEntry) String() string { method ProtoMessage (line 278) | func (*LogEntry) ProtoMessage() {} method ProtoReflect (line 280) | func (x *LogEntry) ProtoReflect() protoreflect.Message { method Descriptor (line 293) | func (*LogEntry) Descriptor() ([]byte, []int) { method GetCommand (line 297) | func (x *LogEntry) GetCommand() []byte { method GetTerm (line 304) | func (x *LogEntry) GetTerm() int64 { type AppendEntriesResponse (line 312) | type AppendEntriesResponse struct method Reset (line 323) | func (x *AppendEntriesResponse) Reset() { method String (line 332) | func (x *AppendEntriesResponse) String() string { method ProtoMessage (line 336) | func (*AppendEntriesResponse) ProtoMessage() {} method ProtoReflect (line 338) | func (x *AppendEntriesResponse) ProtoReflect() protoreflect.Message { method Descriptor (line 351) | func (*AppendEntriesResponse) Descriptor() ([]byte, []int) { method GetTerm (line 355) | func (x *AppendEntriesResponse) GetTerm() int64 { method GetSuccess (line 362) | func (x *AppendEntriesResponse) GetSuccess() bool { function file_raft_v1_raft_proto_rawDescGZIP (line 453) | func file_raft_v1_raft_proto_rawDescGZIP() []byte { function init (line 481) | func init() { file_raft_v1_raft_proto_init() } function file_raft_v1_raft_proto_init (line 482) | func file_raft_v1_raft_proto_init() { FILE: internal/proto/raft/v1/raft_grpc.pb.go constant _ (line 20) | _ = grpc.SupportPackageIsVersion7 type RaftServiceClient (line 25) | type RaftServiceClient interface type raftServiceClient (line 32) | type raftServiceClient struct method RequestVote (line 40) | func (c *raftServiceClient) RequestVote(ctx context.Context, in *Reque... method AppendEntries (line 49) | func (c *raftServiceClient) AppendEntries(ctx context.Context, in *App... function NewRaftServiceClient (line 36) | func NewRaftServiceClient(cc grpc.ClientConnInterface) RaftServiceClient { type RaftServiceServer (line 61) | type RaftServiceServer interface type UnimplementedRaftServiceServer (line 69) | type UnimplementedRaftServiceServer struct method RequestVote (line 72) | func (UnimplementedRaftServiceServer) RequestVote(context.Context, *Re... method AppendEntries (line 75) | func (UnimplementedRaftServiceServer) AppendEntries(context.Context, *... type UnsafeRaftServiceServer (line 82) | type UnsafeRaftServiceServer interface function RegisterRaftServiceServer (line 86) | func RegisterRaftServiceServer(s grpc.ServiceRegistrar, srv RaftServiceS... function _RaftService_RequestVote_Handler (line 90) | func _RaftService_RequestVote_Handler(srv interface{}, ctx context.Conte... function _RaftService_AppendEntries_Handler (line 108) | func _RaftService_AppendEntries_Handler(srv interface{}, ctx context.Con... FILE: internal/raft/consensus.go type LogEntry (line 20) | type LogEntry struct type CMState (line 25) | type CMState method String (line 34) | func (s CMState) String() string { constant Follower (line 28) | Follower CMState = iota constant Candidate (line 29) | Candidate constant Leader (line 30) | Leader constant Dead (line 31) | Dead type ConsensusModule (line 49) | type ConsensusModule struct method restoreFromStorage (line 108) | func (cm *ConsensusModule) restoreFromStorage() { method persistToStorage (line 117) | func (cm *ConsensusModule) persistToStorage(rollback, entries []LogEnt... method restoreLastApplied (line 132) | func (cm *ConsensusModule) restoreLastApplied() { method commitChanSender (line 147) | func (cm *ConsensusModule) commitChanSender() { method Report (line 174) | func (cm *ConsensusModule) Report() (id int64, term int64, isLeader bo... method Stop (line 180) | func (cm *ConsensusModule) Stop() { method Submit (line 188) | func (cm *ConsensusModule) Submit(command []byte) bool { method dlog (line 206) | func (cm *ConsensusModule) dlog(format string, args ...interface{}) { method becomeFollower (line 213) | func (cm *ConsensusModule) becomeFollower(term int64) { method RequestVote (line 223) | func (cm *ConsensusModule) RequestVote(ctx context.Context, request *r... method AppendEntries (line 257) | func (cm *ConsensusModule) AppendEntries(ctx context.Context, request ... method lastLogIndexAndTerm (line 327) | func (cm *ConsensusModule) lastLogIndexAndTerm() (int, int64) { method electionTimeout (line 337) | func (cm *ConsensusModule) electionTimeout() time.Duration { method runElectionTimer (line 341) | func (cm *ConsensusModule) runElectionTimer() { method startElection (line 375) | func (cm *ConsensusModule) startElection() { method startLeader (line 440) | func (cm *ConsensusModule) startLeader() { method leaderSendHeartbeats (line 467) | func (cm *ConsensusModule) leaderSendHeartbeats() { function NewConsensusModule (line 72) | func NewConsensusModule(id int64, peerIds []int64, server *Server, ready... function intMin (line 559) | func intMin(a, b int) int { FILE: internal/raft/fortest.go function MakeCluster (line 11) | func MakeCluster(n int) []*Server { function WaitSettingAddr (line 38) | func WaitSettingAddr(svcs []*Server) map[int64]string { function CheckLeader (line 63) | func CheckLeader(svcs []*Server) int { function GetLeader (line 76) | func GetLeader(svcs []*Server) int { FILE: internal/raft/raft_test.go function TestLeader (line 12) | func TestLeader(t *testing.T) { function TestSubmit (line 48) | func TestSubmit(t *testing.T) { function TestLeaderDown (line 143) | func TestLeaderDown(t *testing.T) { function TestNetworkPartition (line 189) | func TestNetworkPartition(t *testing.T) { function TestFollowerDown (line 231) | func TestFollowerDown(t *testing.T) { FILE: internal/raft/server.go type Server (line 31) | type Server struct method Serve (line 71) | func (s *Server) Serve() { method DisconnectAll (line 159) | func (s *Server) DisconnectAll() { method Shutdown (line 169) | func (s *Server) Shutdown() { method GetListenAddr (line 174) | func (s *Server) GetListenAddr() string { method SetServerAddr (line 185) | func (s *Server) SetServerAddr(sidAddr map[int64]string) { method ConnectToPeer (line 191) | func (s *Server) ConnectToPeer(peerId int64, addr string) error { method DisconnectPeer (line 205) | func (s *Server) DisconnectPeer(peerId int64) error { method WaitConnectToPeers (line 215) | func (s *Server) WaitConnectToPeers() { function NewServer (line 51) | func NewServer(sid int64, cluster string, ready <-chan struct{}) *Server { type RPCProxy (line 240) | type RPCProxy struct method RequestVote (line 244) | func (rpp *RPCProxy) RequestVote(ctx context.Context, request *raftv1.... method AppendEntries (line 259) | func (rpp *RPCProxy) AppendEntries(ctx context.Context, request *raftv... function GetClusterIdAddr (line 274) | func GetClusterIdAddr(cluster string) (map[int64]string, error) { FILE: internal/raft/storage.go constant raftLogFileName (line 18) | raftLogFileName = "rlog" constant defaultAllocSize (line 19) | defaultAllocSize = 1024 * 1024 type RaftPersistent (line 22) | type RaftPersistent struct method InitAndLoadLog (line 31) | func (rp *RaftPersistent) InitAndLoadLog(dest *[]LogEntry) error { method AppendLog (line 84) | func (rp *RaftPersistent) AppendLog(rollback, entries []LogEntry) error { method LogLen (line 138) | func (rp *RaftPersistent) LogLen() int64 { method SetTerm (line 142) | func (rp *RaftPersistent) SetTerm(term int64) error { method GetTerm (line 148) | func (rp *RaftPersistent) GetTerm() int64 { method SetVotedFor (line 152) | func (rp *RaftPersistent) SetVotedFor(votefor int64) error { method GetVotedFor (line 158) | func (rp *RaftPersistent) GetVotedFor() int64 { FILE: internal/statemachine/db.go constant defaultKVDBFileName (line 14) | defaultKVDBFileName = "data" constant LastAppliedKey (line 15) | LastAppliedKey = "kvdbLastApplied" type KVDB (line 18) | type KVDB struct method Set (line 42) | func (k *KVDB) Set(key, value string) error { method Get (line 49) | func (k *KVDB) Get(key string) (string, error) { method Delete (line 64) | func (k *KVDB) Delete(key string) error { method Call (line 79) | func (k *KVDB) Call(command []byte) error { method CommandCheck (line 99) | func (k *KVDB) CommandCheck(command []byte) bool { function NewKVDB (line 22) | func NewKVDB() (IKVDB, error) { type Cmd (line 71) | type Cmd struct FILE: internal/statemachine/interface.go type IKVDB (line 3) | type IKVDB interface FILE: main.go function main (line 10) | func main() {