code: func (k *KVS) Apply(args *structs.KVSRequest, reply *bool) error {
  	if done, err := k.srv.forward("KVS.Apply", args, args, reply); done {
  		return err
  	}
  	defer metrics.MeasureSince([]string{"kvs", "apply"}, time.Now())
  
  	// Perform the pre-apply checks.
  	acl, err := k.srv.ResolveToken(args.Token)
  	if err != nil {
  		return err
  	}
  	ok, err := kvsPreApply(k.srv, acl, args.Op, &args.DirEnt)
  	if err != nil {
  		return err
  	}
  	if !ok {
  		*reply = false
  		return nil
  	}
  
  	// Apply the update.
  	resp, err := k.srv.raftApply(structs.KVSRequestType, args)
  	if err != nil {
  		k.srv.logger.Printf("[ERR] consul.kvs: Apply failed: %v", err)
  		return err
  	}
  	if respErr, ok := resp.(error); ok {
  		return respErr
  	}
  
  	// Check if the return type is a bool.
  	if respBool, ok := resp.(bool); ok {
  		*reply = respBool
  	}
  	return nil
  }
docs: // Apply is used to apply a KVS update request to the data store.