code: func applyRepoMiddleware(ctx context.Context, repository distribution.Repository, middlewares []configuration.Middleware) (distribution.Repository, error) {
  	for _, mw := range middlewares {
  		rmw, err := repositorymiddleware.Get(ctx, mw.Name, mw.Options, repository)
  		if err != nil {
  			return nil, err
  		}
  		repository = rmw
  	}
  	return repository, nil
  }
docs: // applyRepoMiddleware wraps a repository with the configured middlewares