code: func GetImageReferencesAndAuth(ctx context.Context, rs registry.Service,
  	authResolver func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig,
  	imgName string,
  ) (ImageRefAndAuth, error) {
  	ref, err := reference.ParseNormalizedNamed(imgName)
  	if err != nil {
  		return ImageRefAndAuth{}, err
  	}
  
  	// Resolve the Repository name from fqn to RepositoryInfo
  	var repoInfo *registry.RepositoryInfo
  	if rs != nil {
  		repoInfo, err = rs.ResolveRepository(ref)
  	} else {
  		repoInfo, err = registry.ParseRepositoryInfo(ref)
  	}
  
  	if err != nil {
  		return ImageRefAndAuth{}, err
  	}
  
  	authConfig := authResolver(ctx, repoInfo.Index)
  	return ImageRefAndAuth{
  		original:   imgName,
  		authConfig: &authConfig,
  		reference:  ref,
  		repoInfo:   repoInfo,
  		tag:        getTag(ref),
  		digest:     getDigest(ref),
  	}, nil
  }
docs: // GetImageReferencesAndAuth retrieves the necessary reference and auth information for an image name
  // as an ImageRefAndAuth struct