Exemplo n.º 1
0
func removeProc(pid int, db *levigo.DB) error {
	wo := levigo.NewWriteOptions()
	err := db.Delete(wo, []byte(strconv.Itoa(pid)))
	if err != nil {
		return err
	}
	return killProc(pid)

}
Exemplo n.º 2
0
func (dr DeleteRequest) Execute(database *levigo.DB, ro *levigo.ReadOptions, wo *levigo.WriteOptions) (*KMinValues, error) {
	if dr.Key == "" {
		return nil, NoKeySpecified
	}

	keyBytes := []byte(dr.Key)
	err := database.Delete(wo, keyBytes)

	return nil, err
}
Exemplo n.º 3
0
/*
DelKey deletes key from provided DB handle.
*/
func DelKey(key string, db *levigo.DB) bool {
	writer := levigo.NewWriteOptions()
	defer writer.Close()

	err := db.Delete(writer, []byte(key))
	if err != nil {
		golerror.Boohoo("Key "+key+" query failed.", false)
		return false
	}
	return true
}