code: func newIndexInfo(config *serviceConfig, indexName string) (*registrytypes.IndexInfo, error) {
  	var err error
  	indexName, err = ValidateIndexName(indexName)
  	if err != nil {
  		return nil, err
  	}
  
  	// Return any configured index info, first.
  	if index, ok := config.IndexConfigs[indexName]; ok {
  		return index, nil
  	}
  
  	// Construct a non-configured index info.
  	index := &registrytypes.IndexInfo{
  		Name:     indexName,
  		Mirrors:  make([]string, 0),
  		Official: false,
  	}
  	index.Secure = isSecureIndex(config, indexName)
  	return index, nil
  }
docs: // newIndexInfo returns IndexInfo configuration from indexName