Example #1
0
func Set(p Proposer, path string, body []byte, rev int64) (e store.Event) {
	e.Mut, e.Err = store.EncodeSet(path, string(body), rev)
	if e.Err != nil {
		return
	}

	return p.Propose([]byte(e.Mut))
}
Example #2
0
func setReady(p consensus.Proposer, self string) {
	m, err := store.EncodeSet("/ctl/node/"+self+"/writable", "true", 0)
	if err != nil {
		log.Println(err)
		return
	}
	p.Propose([]byte(m))
}