Exemple #1
0
func mustEncodeSet(k, v string) string {
	m, err := store.EncodeSet(k, v, store.Clobber)
	if err != nil {
		panic(err)
	}
	return m
}
Exemple #2
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))
}
Exemple #3
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))
}
Exemple #4
0
func Set(p Proposer, path, body, cas string) (uint64, string, os.Error) {
	mut, err := store.EncodeSet(path, body, cas)
	if err != nil {
		return 0, "", err
	}

	return p.Propose(mut)
}