code: func blobDispatcher(ctx *Context, r *http.Request) http.Handler {
  	dgst, err := getDigest(ctx)
  	if err != nil {
  
  		if err == errDigestNotAvailable {
  			return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
  				ctx.Errors = append(ctx.Errors, v2.ErrorCodeDigestInvalid.WithDetail(err))
  			})
  		}
  
  		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
  			ctx.Errors = append(ctx.Errors, v2.ErrorCodeDigestInvalid.WithDetail(err))
  		})
  	}
  
  	blobHandler := &blobHandler{
  		Context: ctx,
  		Digest:  dgst,
  	}
  
  	mhandler := handlers.MethodHandler{
  		"GET":  http.HandlerFunc(blobHandler.GetBlob),
  		"HEAD": http.HandlerFunc(blobHandler.GetBlob),
  	}
  
  	if !ctx.readOnly {
  		mhandler["DELETE"] = http.HandlerFunc(blobHandler.DeleteBlob)
  	}
  
  	return mhandler
  }
docs: // blobDispatcher uses the request context to build a blobHandler.