mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-21 14:23:34 +00:00
Initial merge of faas-containerd
This patch completes part of the work in #20 by porting the code for faas-containerd in-tree. When tested, I was able to deploy and then remove figlet from the store on `x86_64`. In a follow-up PR, duplication will be removed where possible and consolidated with updated documentation. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
cda1fe78b1
commit
42e9c91ee9
29
vendor/github.com/openfaas/faas/gateway/requests/forward_request.go
generated
vendored
Normal file
29
vendor/github.com/openfaas/faas/gateway/requests/forward_request.go
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
package requests
|
||||
|
||||
import "fmt"
|
||||
import "net/url"
|
||||
|
||||
// ForwardRequest for proxying incoming requests
|
||||
type ForwardRequest struct {
|
||||
RawPath string
|
||||
RawQuery string
|
||||
Method string
|
||||
}
|
||||
|
||||
// NewForwardRequest create a ForwardRequest
|
||||
func NewForwardRequest(method string, url url.URL) ForwardRequest {
|
||||
return ForwardRequest{
|
||||
Method: method,
|
||||
RawQuery: url.RawQuery,
|
||||
RawPath: url.Path,
|
||||
}
|
||||
}
|
||||
|
||||
// ToURL create formatted URL
|
||||
func (f *ForwardRequest) ToURL(addr string, watchdogPort int) string {
|
||||
if len(f.RawQuery) > 0 {
|
||||
return fmt.Sprintf("http://%s:%d%s?%s", addr, watchdogPort, f.RawPath, f.RawQuery)
|
||||
}
|
||||
return fmt.Sprintf("http://%s:%d%s", addr, watchdogPort, f.RawPath)
|
||||
|
||||
}
|
23
vendor/github.com/openfaas/faas/gateway/requests/prometheus.go
generated
vendored
Normal file
23
vendor/github.com/openfaas/faas/gateway/requests/prometheus.go
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (c) Alex Ellis 2017. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
package requests
|
||||
|
||||
// PrometheusInnerAlertLabel PrometheusInnerAlertLabel
|
||||
type PrometheusInnerAlertLabel struct {
|
||||
AlertName string `json:"alertname"`
|
||||
FunctionName string `json:"function_name"`
|
||||
}
|
||||
|
||||
// PrometheusInnerAlert PrometheusInnerAlert
|
||||
type PrometheusInnerAlert struct {
|
||||
Status string `json:"status"`
|
||||
Labels PrometheusInnerAlertLabel `json:"labels"`
|
||||
}
|
||||
|
||||
// PrometheusAlert as produced by AlertManager
|
||||
type PrometheusAlert struct {
|
||||
Status string `json:"status"`
|
||||
Receiver string `json:"receiver"`
|
||||
Alerts []PrometheusInnerAlert `json:"alerts"`
|
||||
}
|
18
vendor/github.com/openfaas/faas/gateway/requests/requests.go
generated
vendored
Normal file
18
vendor/github.com/openfaas/faas/gateway/requests/requests.go
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// Copyright (c) Alex Ellis 2017. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
// Package requests package provides a client SDK or library for
|
||||
// the OpenFaaS gateway REST API
|
||||
package requests
|
||||
|
||||
// AsyncReport is the report from a function executed on a queue worker.
|
||||
type AsyncReport struct {
|
||||
FunctionName string `json:"name"`
|
||||
StatusCode int `json:"statusCode"`
|
||||
TimeTaken float64 `json:"timeTaken"`
|
||||
}
|
||||
|
||||
// DeleteFunctionRequest delete a deployed function
|
||||
type DeleteFunctionRequest struct {
|
||||
FunctionName string `json:"functionName"`
|
||||
}
|
Reference in New Issue
Block a user