mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 00:06:38 +00:00
Migrate away from requests package for Function structs
The function deployment and status structs have been moved away into the faas-provider package. Tested with a build, running tests, and CI. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
8767514527
commit
df97efafae
@ -10,7 +10,7 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
||||
"github.com/openfaas/faas/gateway/requests"
|
||||
types "github.com/openfaas/faas-provider/types"
|
||||
)
|
||||
|
||||
// AddMetricsHandler wraps a http.HandlerFunc with Prometheus metrics
|
||||
@ -37,7 +37,7 @@ func AddMetricsHandler(handler http.HandlerFunc, prometheusQuery PrometheusQuery
|
||||
}
|
||||
|
||||
upstreamBody, _ := ioutil.ReadAll(upstreamCall.Body)
|
||||
var functions []requests.Function
|
||||
var functions []types.FunctionStatus
|
||||
|
||||
err := json.Unmarshal(upstreamBody, &functions)
|
||||
|
||||
@ -75,7 +75,7 @@ func AddMetricsHandler(handler http.HandlerFunc, prometheusQuery PrometheusQuery
|
||||
}
|
||||
}
|
||||
|
||||
func mixIn(functions *[]requests.Function, metrics *VectorQueryResponse) {
|
||||
func mixIn(functions *[]types.FunctionStatus, metrics *VectorQueryResponse) {
|
||||
if functions == nil {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user