Documentation ¶
Index ¶
- Constants
- func NewPair(key, val string) pair
- func NewPeer(name, ip string) *peer
- func NewPeerFromGossiper(g *Gossiper) *peer
- func Newdb(path string) (int, *mydb, error)
- func Newlogger() *logger
- func TearDown(name string)
- type Gossiper
- func (g *Gossiper) AddPeer(p *peer) int
- func (g *Gossiper) CheckSyncClient()
- func (g *Gossiper) Delete(key string)
- func (g *Gossiper) Get(key string) string
- func (g *Gossiper) GetDB() *mydb
- func (g *Gossiper) GetHeartBeatTimer() *time.Timer
- func (g *Gossiper) GetIP() string
- func (g *Gossiper) GetLogger() *logger
- func (g *Gossiper) GetName() string
- func (g *Gossiper) GetPeers() map[string]*peer
- func (g *Gossiper) GetTerminateChan() chan int
- func (g *Gossiper) HeartBeatHandler(w http.ResponseWriter, r *http.Request)
- func (g *Gossiper) HeartBeatReceiver()
- func (g *Gossiper) PopLeft() logEntry
- func (g *Gossiper) PrintPeerNames()
- func (g *Gossiper) Push(l logEntry)
- func (g *Gossiper) Put(key, value string)
- func (g *Gossiper) ReadLogsFromFile()
- func (g *Gossiper) RemovePeer(name string) int
- func (g *Gossiper) SendHeartBeat(p *peer) (int, error)
- func (g *Gossiper) SendHeartBeats() (int, error)
- func (g *Gossiper) Start()
- func (g *Gossiper) Stop()
- func (g *Gossiper) SyncClientStart(logEntryNum int)
- func (g *Gossiper) SyncServerStart()
- func (g *Gossiper) WriteLogToFile()
- func (g *Gossiper) WritePeersToFile()
- type PeerPair
Constants ¶
View Source
const ( PUT = "PUT" DELETE = "DELETE" )
View Source
const FIXED_DIFF = 400
View Source
const HEARTBEAT_PATH = "heartbeat"
View Source
const HEARTBEAT_PORT = ":8002"
View Source
const HEARTBEAT_TIMEOUT = 1000
View Source
const SYNC_PORT = 8001
Variables ¶
This section is empty.
Functions ¶
func NewPeerFromGossiper ¶
func NewPeerFromGossiper(g *Gossiper) *peer
Types ¶
type Gossiper ¶
func NewGossiper ¶
func (*Gossiper) CheckSyncClient ¶
func (g *Gossiper) CheckSyncClient()
func (*Gossiper) GetHeartBeatTimer ¶
func (*Gossiper) GetTerminateChan ¶
func (*Gossiper) HeartBeatHandler ¶
func (g *Gossiper) HeartBeatHandler(w http.ResponseWriter, r *http.Request)
func (*Gossiper) HeartBeatReceiver ¶
func (g *Gossiper) HeartBeatReceiver()
func (*Gossiper) PrintPeerNames ¶
func (g *Gossiper) PrintPeerNames()
func (*Gossiper) ReadLogsFromFile ¶
func (g *Gossiper) ReadLogsFromFile()
func (*Gossiper) RemovePeer ¶
func (*Gossiper) SendHeartBeat ¶
func (*Gossiper) SendHeartBeats ¶
func (*Gossiper) SyncClientStart ¶
func (*Gossiper) SyncServerStart ¶
func (g *Gossiper) SyncServerStart()
func (*Gossiper) WriteLogToFile ¶
func (g *Gossiper) WriteLogToFile()
func (*Gossiper) WritePeersToFile ¶
func (g *Gossiper) WritePeersToFile()
Click to show internal directories.
Click to hide internal directories.