// ReceiveOCNHandleFunc returns a http.HandlerFunc that receives OCN.
// The path is for
171983
func ReceiveOCNHandleFunc(bucketName, queueName, path string, kindNames []string) http.HandlerFunc {
	// TODO: processWithContext
	return func(w http.ResponseWriter, r *http.Request) {
		c := appengine.NewContext(r)

		obj, err := DecodeGCSObject(r.Body)
		if err != nil {
			log.Errorf(c, "ds2bq: failed to decode request: %s", err)
			return
		}
		defer r.Body.Close()

		if !obj.IsImportTarget(c, r, bucketName, kindNames) {
			return
		}

		err = ReceiveOCN(c, obj, queueName, path)
		if err != nil {
			log.Errorf(c, "ds2bq: failed to receive OCN: %s", err)
			return
		}
	}
}
1256837
func (mux *TypeMux) HandleFunc(t Type, f HandlerFunc) {
	mux.Handle(t, f)
}
201486
func (mux *ServeMux) HandleFunc(pattern string,
	f func(l *net.UDPConn, a *net.UDPAddr, m *Message) *Message) {
	mux.Handle(pattern, FuncHandler(f))
}
518065
func (s *Secure) HandlerFuncWithNext(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
	// Let secure process the request. If it returns an error,
	// that indicates the request should not continue.
	responseHeader, r, err := s.processRequest(w, r)
	addResponseHeaders(responseHeader, w)

	// If there was an error, do not call next.
	if err == nil && next != nil {
		next(w, r)
	}
}
1027545
func (m *Mux) HandleFuncC(p Pattern, h func(context.Context, http.ResponseWriter, *http.Request)) {
	m.HandleC(p, HandlerFunc(h))
}
288295
func (c PubSubConn) ReceiveWithTimeout(timeout time.Duration) interface{} {
	return c.receiveInternal(ReceiveWithTimeout(c.Conn, timeout))
}
767061
func (r *Router) HandleFunc(method, pattern string, fn http.HandlerFunc) Route {
	return r.Handle(method, pattern, http.HandlerFunc(fn))
}
927820
func (m *Mux) HandleFunc(expr string, handler func(http.ResponseWriter, *http.Request)) error {
	return m.Handle(expr, http.HandlerFunc(handler))
}
960686
func (r *Route) ConnectFunc(f http.HandlerFunc) *Route {
	return r.Connect(http.HandlerFunc(f))
}
173168
func (n *NetStore) FetchFunc(ctx context.Context, ref Address) func(context.Context) error {
	chunk, fetch, _ := n.get(ctx, ref)
	if chunk != nil {
		return nil
	}
	return func(ctx context.Context) error {
		_, err := fetch(ctx)
		return err
	}
}
963711
func (r *Router) OptionsFunc(pattern string, fn http.HandlerFunc) Route {
	return r.Options(pattern, http.HandlerFunc(fn))
}
197486
func (n *Negroni) UseFunc(handlerFunc func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)) {
	n.Use(HandlerFunc(handlerFunc))
}
797009
func HTTPHandlerFunc(h http.HandlerFunc) Handler {
	return func(c *Context) error {
		h(c.Response, c.Request)
		return nil
	}
}
405523
func (sm *ServeMux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request) error) {
	sm.ServeMux.Handle(pattern, sm.HandlerFunc(handler))
}
1130695
func BearerFunc(authfn func(string) bool) macaron.Handler {
	return func(res http.ResponseWriter, req *http.Request, c *macaron.Context) {
		auth := req.Header.Get("Authorization")
		n := len(bearerPrefix)
		if len(auth) < n || auth[:n] != bearerPrefix {
			bearerUnauthorized(res)
			return
		}
		if !authfn(auth[n:]) {
			bearerUnauthorized(res)
			return
		}
		c.Map(User(""))
	}
}
789167
func (r *Router) HandleFunc(path string, f func(context.Context, http.ResponseWriter, *http.Request) error) *Route {
	return r.Handle(path, HandlerFunc(f))
}
336392
func (pcond *ReqProxyConds) DoFunc(f func(req *http.Request, ctx *ProxyCtx) (*http.Request, *http.Response)) {
	pcond.Do(FuncReqHandler(f))
}