code: func NewRegistrar(scope, namePrefix string, entities ...DomainObject) (Registrar, error) {
  	if err := IsValidNamePrefix(namePrefix); err != nil {
  		return nil, errors.Wrap(err, "failed to construct Registrar")
  	}
  	typeIndex := make(map[reflect.Type]*RegisteredEntity)
  
  	for _, e := range entities {
  		table, err := TableFromInstance(e)
  		if err != nil {
  			return nil, errors.Wrapf(err, "failed to register entity")
  		}
  
  		// use entity type as internal lookup key
  		typ := reflect.TypeOf(e).Elem()
  
  		// create instance and index it
  		re := NewRegisteredEntity(scope, namePrefix, table)
  		typeIndex[typ] = re
  	}
  
  	return &prefixedRegistrar{
  		scope:      scope,
  		namePrefix: namePrefix,
  		typeIndex:  typeIndex,
  	}, nil
  }
docs: // NewRegistrar returns a new Registrar for the scope, name prefix and
  // entities provided. `dosa.Client` implementations are intended to use scope
  // and prefix to uniquely identify where entities should live but the
  // registrar itself is only responsible for basic accounting of entities.