github.com/blend/go-sdk@v1.20220411.3/web/handler.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package web
     9  
    10  import "net/http"
    11  
    12  // Handler is the most basic route handler.
    13  type Handler func(http.ResponseWriter, *http.Request, *Route, RouteParameters)
    14  
    15  // WrapHandler wraps an http.Handler as a Handler.
    16  func WrapHandler(handler http.Handler) Handler {
    17  	return func(w http.ResponseWriter, r *http.Request, _ *Route, _ RouteParameters) {
    18  		handler.ServeHTTP(w, r)
    19  	}
    20  }