func bgDel(p consensus.Proposer, k string, c int64) chan store.Event { ch := make(chan store.Event) go func() { ch <- consensus.Del(p, k, c) }() return ch }
func (t *txn) del() { if t.c.access == false { t.respondOsError(os.EACCES) return } if !t.c.canWrite { t.respondErrCode(response_READONLY) return } if t.req.Path == nil || t.req.Rev == nil { t.respondErrCode(response_MISSING_ARG) return } go func() { ev := consensus.Del(t.c.p, *t.req.Path, *t.req.Rev) if ev.Err != nil { t.respondOsError(ev.Err) return } t.respond() }() }
func removeInfo(p consensus.Proposer, g store.Getter, name string) { glob, err := store.CompileGlob("/ctl/node/" + name + "/**") if err != nil { log.Println(err) return } store.Walk(g, glob, func(path, _ string, rev int64) bool { consensus.Del(p, path, rev) return false }) }
func Clean(p consensus.Proposer, ch <-chan store.Event) { for ev := range ch { if ev.IsDel() { name := ev.Path[len(SessDir)+1:] store.Walk(ev, locks, func(path, body string, rev int64) bool { if body == name { go consensus.Del(p, path, rev) } return false }) } } }