server, examples, extensions lint compliant (#1109)

these are all automated changes suggested by golint
This commit is contained in:
Reed Allman
2018-07-04 09:23:15 -05:00
committed by Owen Cliffe
parent 6f5e58144a
commit 1cdb47d6e9
30 changed files with 355 additions and 223 deletions

View File

@@ -6,38 +6,46 @@ import (
"github.com/fnproject/fn/api/models"
)
type ApiHandlerFunc func(w http.ResponseWriter, r *http.Request)
// APIHandlerFunc is a convenience to make an APIHandler.
type APIHandlerFunc func(w http.ResponseWriter, r *http.Request)
// ServeHTTP calls f(w, r).
func (f ApiHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (f APIHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
f(w, r)
}
type ApiHandler interface {
// APIHandler may be used to add an http endpoint on the versioned route of the Fn API.
type APIHandler interface {
// Handle(ctx context.Context)
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
type ApiAppHandler interface {
// APIAppHandler may be used to add an http endpoint on the versioned route of fn API,
// at /:version/apps/:app
type APIAppHandler interface {
// Handle(ctx context.Context)
ServeHTTP(w http.ResponseWriter, r *http.Request, app *models.App)
}
type ApiAppHandlerFunc func(w http.ResponseWriter, r *http.Request, app *models.App)
// APIAppHandlerFunc is a convenience for getting an APIAppHandler.
type APIAppHandlerFunc func(w http.ResponseWriter, r *http.Request, app *models.App)
// ServeHTTP calls f(w, r).
func (f ApiAppHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request, app *models.App) {
func (f APIAppHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request, app *models.App) {
f(w, r, app)
}
type ApiRouteHandler interface {
// APIRouteHandler may be used to add an http endpoint on the versioned route of fn API,
// at /:version/apps/:app/routes/:route
type APIRouteHandler interface {
// Handle(ctx context.Context)
ServeHTTP(w http.ResponseWriter, r *http.Request, app *models.App, route *models.Route)
}
type ApiRouteHandlerFunc func(w http.ResponseWriter, r *http.Request, app *models.App, route *models.Route)
// APIRouteHandlerFunc is a convenience for getting an APIRouteHandler.
type APIRouteHandlerFunc func(w http.ResponseWriter, r *http.Request, app *models.App, route *models.Route)
// ServeHTTP calls f(w, r).
func (f ApiRouteHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request, app *models.App, route *models.Route) {
func (f APIRouteHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request, app *models.App, route *models.Route) {
f(w, r, app, route)
}