code: func applyRegistryMiddleware(ctx context.Context, registry distribution.Namespace, middlewares []configuration.Middleware) (distribution.Namespace, error) {
  	for _, mw := range middlewares {
  		rmw, err := registrymiddleware.Get(ctx, mw.Name, mw.Options, registry)
  		if err != nil {
  			return nil, fmt.Errorf("unable to configure registry middleware (%s): %s", mw.Name, err)
  		}
  		registry = rmw
  	}
  	return registry, nil
  
  }
docs: // applyRegistryMiddleware wraps a registry instance with the configured middlewares