code: func (s *Store) SessionList(ws memdb.WatchSet) (uint64, structs.Sessions, error) {
  	tx := s.db.Txn(false)
  	defer tx.Abort()
  
  	// Get the table index.
  	idx := maxIndexTxn(tx, "sessions")
  
  	// Query all of the active sessions.
  	sessions, err := tx.Get("sessions", "id")
  	if err != nil {
  		return 0, nil, fmt.Errorf("failed session lookup: %s", err)
  	}
  	ws.Add(sessions.WatchCh())
  
  	// Go over the sessions and create a slice of them.
  	var result structs.Sessions
  	for session := sessions.Next(); session != nil; session = sessions.Next() {
  		result = append(result, session.(*structs.Session))
  	}
  	return idx, result, nil
  }
docs: // SessionList returns a slice containing all of the active sessions.