code: func (e *RegisteredEntity) KeyFieldValues(entity DomainObject) map[string]FieldValue {
  	v := reflect.ValueOf(entity).Elem()
  	fieldValues := make(map[string]FieldValue)
  
  	// populate partition key values
  	for _, pk := range e.table.Key.PartitionKeys {
  		fieldName := e.table.ColToField[pk]
  		value := v.FieldByName(fieldName)
  		fieldValues[pk] = value.Interface()
  	}
  
  	// populate clustering key values
  	for _, ck := range e.table.Key.ClusteringKeys {
  		fieldName := e.table.ColToField[ck.Name]
  		value := v.FieldByName(fieldName)
  		if !value.IsValid() {
  			// this should never happen
  			panic("Field " + fieldName + " is not a valid field for " + e.table.StructName)
  		}
  		fieldValues[ck.Name] = value.Interface()
  	}
  
  	return fieldValues
  }
docs: // KeyFieldValues is a helper for generating a map of field values to be used in a query.