mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Largely a removal job, however many tests, particularly system level ones relied on Routes. These have been migrated to use Fns. * Add 410 response to swagger * No app names in log tags * Adding constraint in GetCall for FnID * Adding test to check FnID is required on call * Add fn_id to call selector * Fix text in docker mem warning * Correct buildConfig func name * Test fix up * Removing CPU setting from Agent test CPU setting has been deprecated, but the code base is still riddled with it. This just removes it from this layer. Really we need to remove it from Call. * Remove fn id check on calls * Reintroduce fn id required on call * Adding fnID to calls for execute test * Correct setting of app id in middleware * Removes root middlewares ability to redirect fun invocations * Add over sized test check * Removing call fn id check
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package fnext
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/fnproject/fn/api/models"
|
|
)
|
|
|
|
// 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) {
|
|
f(w, r)
|
|
}
|
|
|
|
// 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)
|
|
}
|
|
|
|
// 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)
|
|
}
|
|
|
|
// 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) {
|
|
f(w, r, app)
|
|
}
|