code: func (s *Store) kvsCheckSessionTxn(tx *memdb.Txn, key string, session string) (*structs.DirEntry, error) {
  	entry, err := tx.First("kvs", "id", key)
  	if err != nil {
  		return nil, fmt.Errorf("failed kvs lookup: %s", err)
  	}
  	if entry == nil {
  		return nil, fmt.Errorf("failed to check session, key %q doesn't exist", key)
  	}
  
  	e := entry.(*structs.DirEntry)
  	if e.Session != session {
  		return nil, fmt.Errorf("failed session check for key %q, current session %q != %q", key, e.Session, session)
  	}
  
  	return e, nil
  }
docs: // kvsCheckSessionTxn checks to see if the given session matches the current
  // entry for a key.