func (pl *ProfileLoader) DeleteKeyValue(kv *keyvalue.KeyValue) error {
	byteOrder := utils.GetHostByteOrder()
	// Select map
	kMap, ok := pl.collection.Maps[kv.GetMapSection()]
	if !ok {
		return errors.Wrap(errors.New(kv.GetMapSection()), "unknown map")
	}
	// Generate Key unsafe pointer
	keyPtr, err := kv.GetKey(byteOrder)
	if err != nil {
		return errors.Wrapf(err, "couldn't create unsafe pointer key for type %s", reflect.TypeOf(kv.Key))
	}
	// Insert key-value in map
	if err := kMap.Delete(keyPtr); err != nil {
		return errors.Wrapf(err, "failed to delete element in map %s", kv.GetMapSection())
	}
	return nil
}
// DeleteKeyValue - Deletes a key value in the kernel
Deletes a key value in the kernel
// DeleteKeyValue - Deletes a key value in the kernel
func (pl *ProfileLoader) DeleteKeyValue(kv *keyvalue.KeyValue) error {
	byteOrder := utils.GetHostByteOrder()
	kMap, ok := pl.collection.Maps[kv.GetMapSection()]
	if !ok {
		return errors.Wrap(errors.New(kv.GetMapSection()), "unknown map")
	}
	keyPtr, err := kv.GetKey(byteOrder)
	if err != nil {
		return errors.Wrapf(err, "couldn't create unsafe pointer key for type %s", reflect.TypeOf(kv.Key))
	}
	if err := kMap.Delete(keyPtr); err != nil {
		return errors.Wrapf(err, "failed to delete element in map %s", kv.GetMapSection())
	}
	return nil
}
func ( pl * ProfileLoader ) DeleteKeyValue ( kv * keyvalue . KeyValue ) error { byteOrder := utils . GetHostByteOrder ( ) kMap , ok := pl . collection . Maps [ kv . GetMapSection ( ) ] if ! ok { return errors . Wrap ( errors . New ( kv . GetMapSection ( ) ) , " " ) } keyPtr , err := kv . GetKey ( byteOrder ) if err != nil { return errors . Wrapf ( err , " " , reflect . TypeOf ( kv . Key ) ) } if err := kMap . Delete ( keyPtr ) ; err != nil { return errors . Wrapf ( err , " " , kv . GetMapSection ( ) ) } return nil }
Deletes a key value in the kernel
Deletes a key value in the kernel
// Select map // Generate Key unsafe pointer // Insert key-value in map