code: func (s *Store) Intentions(ws memdb.WatchSet) (uint64, structs.Intentions, error) {
  	tx := s.db.Txn(false)
  	defer tx.Abort()
  
  	// Get the index
  	idx := maxIndexTxn(tx, intentionsTableName)
  	if idx < 1 {
  		idx = 1
  	}
  
  	// Get all intentions
  	iter, err := tx.Get(intentionsTableName, "id")
  	if err != nil {
  		return 0, nil, fmt.Errorf("failed intention lookup: %s", err)
  	}
  	ws.Add(iter.WatchCh())
  
  	var results structs.Intentions
  	for ixn := iter.Next(); ixn != nil; ixn = iter.Next() {
  		results = append(results, ixn.(*structs.Intention))
  	}
  
  	// Sort by precedence just because that's nicer and probably what most clients
  	// want for presentation.
  	sort.Sort(structs.IntentionPrecedenceSorter(results))
  
  	return idx, results, nil
  }
docs: // Intentions returns the list of all intentions.