code: func NewRegistry(ctx context.Context, driver storagedriver.StorageDriver, options ...RegistryOption) (distribution.Namespace, error) {
  	// create global statter
  	statter := &blobStatter{
  		driver: driver,
  	}
  
  	bs := &blobStore{
  		driver:  driver,
  		statter: statter,
  	}
  
  	registry := &registry{
  		blobStore: bs,
  		blobServer: &blobServer{
  			driver:  driver,
  			statter: statter,
  			pathFn:  bs.path,
  		},
  		statter:                statter,
  		resumableDigestEnabled: true,
  		driver:                 driver,
  	}
  
  	for _, option := range options {
  		if err := option(registry); err != nil {
  			return nil, err
  		}
  	}
  
  	return registry, nil
  }
docs: // NewRegistry creates a new registry instance from the provided driver. The
  // resulting registry may be shared by multiple goroutines but is cheap to
  // allocate. If the Redirect option is specified, the backend blob server will
  // attempt to use (StorageDriver).URLFor to serve all blobs.