code: func (n *Node) raftLevelGuard() error {
  	switch n.level {
  	default:
  		// a valid level is required
  		return errInvalidConsistencyLevel
  	case Low:
  		// anything goes.
  		return nil
  	case Medium:
  		// must be the leader
  		if n.raft.State() != raft.Leader {
  			return raft.ErrNotLeader
  		}
  		return nil
  	case High:
  		// process a blank command. this will update the raft log index
  		// and allow for readonly commands to process in order without
  		// serializing the actual command.
  		f := n.raft.Apply(nil, raftTimeout)
  		if err := f.Error(); err != nil {
  			return err
  		}
  		// the blank command succeeded.
  		v := f.Response()
  		// check if response was an error and return that.
  		switch v := v.(type) {
  		case nil:
  			return nil
  		case error:
  			return v
  		}
  		return errInvalidResponse
  	}
  }
docs: // raftLevelGuard is used to process readonly commands depending on the
  // consistency readonly level.
  // It either:
  // - low consistency: just processes the command without concern about
  //   leadership or cluster state.
  // - medium consistency: makes sure that the node is the leader first.
  // - high consistency: sends a blank command through the raft pipeline to
  // ensure that the node is thel leader, the raft index is incremented, and
  // that the cluster is sane before processing the readonly command.