示例#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)

}
示例#2
0
文件: db.go 项目: jehiah/gocountme
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
}
示例#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
}