From bb8b883758b07c23314bea83195642a38f4b6301 Mon Sep 17 00:00:00 2001 From: Lucas Roesler Date: Wed, 1 Jan 2020 12:31:00 +0100 Subject: [PATCH] Update faas-provider to 0.14.0 **What** - Update the faas-provider to 0.14.0 - Update the types used in the secrets handler to use the Secret struct from the faas-provider - Remove the FunctionDeleteRequest import so that we can remove the gateway from the vendor list. This decouples the two projects better and removes a dependency change that would require updating the gateway provider version to update this project as well - Test the DeleteHandler - Rename the proivder info variables to use the same names as in faas-netes and faas-containerd, making the info handler code more portable Relates to openfaas/faas-provider#38 Signed-off-by: Lucas Roesler --- Gopkg.lock | 15 +-- Gopkg.toml | 2 +- handlers/delete.go | 18 ++- handlers/delete_test.go | 111 ++++++++++++++++++ handlers/info.go | 20 ++-- handlers/info_test.go | 39 ++++++ handlers/secrets.go | 53 ++++++++- handlers/secrets_test.go | 4 +- test/info_test.go | 61 ---------- .../openfaas/faas-provider/logs/handler.go | 1 + .../openfaas/faas-provider/logs/logs.go | 16 ++- .../openfaas/faas-provider/types/requests.go | 4 +- vendor/github.com/openfaas/faas/LICENSE | 23 ---- .../faas/gateway/requests/forward_request.go | 29 ----- .../faas/gateway/requests/prometheus.go | 23 ---- .../faas/gateway/requests/requests.go | 24 ---- 16 files changed, 244 insertions(+), 199 deletions(-) create mode 100644 handlers/delete_test.go create mode 100644 handlers/info_test.go delete mode 100644 test/info_test.go delete mode 100644 vendor/github.com/openfaas/faas/LICENSE delete mode 100644 vendor/github.com/openfaas/faas/gateway/requests/forward_request.go delete mode 100644 vendor/github.com/openfaas/faas/gateway/requests/prometheus.go delete mode 100644 vendor/github.com/openfaas/faas/gateway/requests/requests.go diff --git a/Gopkg.lock b/Gopkg.lock index fcae2d16..18e08dc7 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -160,15 +160,7 @@ version = "v1.0.1" [[projects]] - digest = "1:0250441ac9f681c839722297897952ee6d633f2a37dc254eca9d6d21bd1e877d" - name = "github.com/openfaas/faas" - packages = ["gateway/requests"] - pruneopts = "UT" - revision = "0a90125aba339a8133009f215ed6d2d8c19277f8" - version = "0.17.4" - -[[projects]] - digest = "1:a32a2587b7ec1ab3661ceaf1779e8dc65d98b3b9482b50184186a3829730c6a7" + digest = "1:7a20be0bdfb2c05a4a7b955cb71645fe2983aa3c0bbae10d6bba3e2dd26ddd0d" name = "github.com/openfaas/faas-provider" packages = [ ".", @@ -179,8 +171,8 @@ "types", ] pruneopts = "UT" - revision = "7677057e416ba796df41f9f366956a491c5684ff" - version = "0.13.2" + revision = "8f7c35975e1b2bf8286c2f90ee51633eec427491" + version = "0.14.0" [[projects]] digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" @@ -249,7 +241,6 @@ "github.com/openfaas/faas-provider/logs", "github.com/openfaas/faas-provider/proxy", "github.com/openfaas/faas-provider/types", - "github.com/openfaas/faas/gateway/requests", "golang.org/x/net/context", ] solver-name = "gps-cdcl" diff --git a/Gopkg.toml b/Gopkg.toml index dbdd2365..e0d4926e 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -8,7 +8,7 @@ [[constraint]] name = "github.com/openfaas/faas-provider" - version = "0.13.2" + version = "0.14.0" [[constraint]] name = "github.com/docker/go-units" diff --git a/handlers/delete.go b/handlers/delete.go index 8b96e685..0ee9cb23 100644 --- a/handlers/delete.go +++ b/handlers/delete.go @@ -10,16 +10,26 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/client" - "github.com/openfaas/faas/gateway/requests" + "github.com/docker/docker/api/types/swarm" ) +type deleteFunctionRequest struct { + FunctionName string `json:"functionName"` +} + +// ServiceDeleter is the sub-interface of client.ServiceAPIClient that is required for deleting +// a OpenFaaS Function. This interface is satisfied by *client.Client +type ServiceDeleter interface { + ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) + ServiceRemove(ctx context.Context, serviceID string) error +} + // DeleteHandler delete a function -func DeleteHandler(c *client.Client) http.HandlerFunc { +func DeleteHandler(c ServiceDeleter) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - req := requests.DeleteFunctionRequest{} + req := deleteFunctionRequest{} defer r.Body.Close() reqData, _ := ioutil.ReadAll(r.Body) unmarshalErr := json.Unmarshal(reqData, &req) diff --git a/handlers/delete_test.go b/handlers/delete_test.go new file mode 100644 index 00000000..7b7485c4 --- /dev/null +++ b/handlers/delete_test.go @@ -0,0 +1,111 @@ +package handlers + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" +) + +type fakeServiceDeleter struct { + services []swarm.Service + listErr error + removeErr error +} + +func (s fakeServiceDeleter) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { + return s.services, s.listErr +} + +func (s fakeServiceDeleter) ServiceRemove(ctx context.Context, serviceID string) error { + return s.removeErr +} + +func Test_DeleteHandler(t *testing.T) { + + cases := []struct { + name string + funcName string + services []swarm.Service + listErr error + removeErr error + expectedCode int + }{ + { + name: "parsing error returns StatusBadRequest", + expectedCode: http.StatusBadRequest, + }, + { + name: "listing error returns StatusNotFound", + funcName: "test-func", + listErr: errors.New("failed to list functions"), + expectedCode: http.StatusNotFound, + }, + { + name: "remove error returns StatusInternalServerError", + funcName: "test-func", + services: []swarm.Service{ + { + ID: "test-func-id", + Spec: swarm.ServiceSpec{ + Annotations: swarm.Annotations{Name: "test-func"}, + TaskTemplate: swarm.TaskSpec{ + ContainerSpec: &swarm.ContainerSpec{ + Labels: map[string]string{"function": "true"}, + }, + }, + }, + }, + }, + removeErr: errors.New("failed to delete function"), + expectedCode: http.StatusInternalServerError, + }, + { + name: "returns Accepted when no errors", + funcName: "test-func", + services: []swarm.Service{ + { + ID: "test-func-id", + Spec: swarm.ServiceSpec{ + Annotations: swarm.Annotations{Name: "test-func"}, + TaskTemplate: swarm.TaskSpec{ + ContainerSpec: &swarm.ContainerSpec{ + Labels: map[string]string{"function": "true"}, + }, + }, + }, + }, + }, + expectedCode: http.StatusAccepted, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + client := fakeServiceDeleter{ + listErr: tc.listErr, + removeErr: tc.removeErr, + services: tc.services, + } + handler := DeleteHandler(client) + + payload := fmt.Sprintf(`{"functionName": %q}`, tc.funcName) + + w := httptest.NewRecorder() + r := httptest.NewRequest("POST", "/", strings.NewReader(payload)) + handler(w, r) + + if w.Code != tc.expectedCode { + t.Fatalf("expected status code %d, got %d", tc.expectedCode, w.Code) + } + + }) + } + +} diff --git a/handlers/info.go b/handlers/info.go index b21d0ee8..36fa3f1f 100644 --- a/handlers/info.go +++ b/handlers/info.go @@ -4,14 +4,14 @@ import ( "encoding/json" "net/http" - "github.com/openfaas/faas-provider/types" + typesv1 "github.com/openfaas/faas-provider/types" ) const ( - //SwarmIdentifier identifier string for swarm provider - SwarmIdentifier = "swarm" - //SwarmProvider provider string for swarm provider - SwarmProvider = "faas-swarm" + //OrchestrationIdentifier identifier string for swarm provider + OrchestrationIdentifier = "swarm" + //ProviderName provider string for swarm provider + ProviderName = "faas-swarm" ) //MakeInfoHandler creates handler for /system/info endpoint @@ -21,16 +21,16 @@ func MakeInfoHandler(version, sha string) http.HandlerFunc { defer r.Body.Close() } - infoRequest := types.InfoRequest{ - Orchestration: SwarmIdentifier, - Provider: SwarmProvider, - Version: types.ProviderVersion{ + infoResponse := typesv1.InfoResponse{ + Orchestration: OrchestrationIdentifier, + Provider: ProviderName, + Version: typesv1.ProviderVersion{ Release: version, SHA: sha, }, } - jsonOut, marshalErr := json.Marshal(infoRequest) + jsonOut, marshalErr := json.Marshal(infoResponse) if marshalErr != nil { w.WriteHeader(http.StatusInternalServerError) return diff --git a/handlers/info_test.go b/handlers/info_test.go new file mode 100644 index 00000000..0576f858 --- /dev/null +++ b/handlers/info_test.go @@ -0,0 +1,39 @@ +package handlers + +import ( + "encoding/json" + "github.com/openfaas/faas-provider/types" + "net/http/httptest" + "testing" +) + +func Test_InfoHandler(t *testing.T) { + sha := "4b825dc642cb6eb9a060e54bf8d69288fbee4904" + version := "0.0.1" + handler := MakeInfoHandler(version, sha) + w := httptest.NewRecorder() + r := httptest.NewRequest("GET", "/", nil) + handler(w, r) + + resp := types.InfoResponse{} + err := json.Unmarshal(w.Body.Bytes(), &resp) + if err != nil { + t.Fatalf("unexpected error unmarshalling the response") + } + + if resp.Provider != ProviderName { + t.Fatalf("expected provider %q, got %q", ProviderName, resp.Provider) + } + + if resp.Orchestration != OrchestrationIdentifier { + t.Fatalf("expected orchestration %q, got %q", OrchestrationIdentifier, resp.Orchestration) + } + + if resp.Version.SHA != sha { + t.Fatalf("expected orchestration %q, got %q", sha, resp.Version.SHA) + } + + if resp.Version.Release != version { + t.Fatalf("expected release %q, got %q", version, resp.Version.Release) + } +} diff --git a/handlers/secrets.go b/handlers/secrets.go index f2339cde..4e1afac5 100644 --- a/handlers/secrets.go +++ b/handlers/secrets.go @@ -10,12 +10,11 @@ import ( "github.com/docker/cli/opts" "github.com/docker/docker/api/types/filters" + typesv1 "github.com/openfaas/faas-provider/types" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" - - "github.com/openfaas/faas/gateway/requests" ) var ( @@ -130,10 +129,10 @@ func getSecrets(c client.SecretAPIClient, _ []byte) (responseStatus int, respons ) } - results := []requests.Secret{} + results := []typesv1.Secret{} for _, s := range secrets { - results = append(results, requests.Secret{Name: s.Spec.Name, Value: string(s.Spec.Data)}) + results = append(results, typesv1.Secret{Name: s.Spec.Name, Value: string(s.Spec.Data)}) } resultsJSON, marshalErr := json.Marshal(results) @@ -148,7 +147,7 @@ func getSecrets(c client.SecretAPIClient, _ []byte) (responseStatus int, respons } func createNewSecret(c client.SecretAPIClient, body []byte) (responseStatus int, responseBody []byte, err error) { - var secret requests.Secret + var secret typesv1.Secret unmarshalErr := json.Unmarshal(body, &secret) if unmarshalErr != nil { @@ -177,8 +176,50 @@ func createNewSecret(c client.SecretAPIClient, body []byte) (responseStatus int, return http.StatusCreated, nil, nil } +func updateSecret(c client.SecretAPIClient, body []byte) (responseStatus int, responseBody []byte, err error) { + var secret typesv1.Secret + + unmarshalErr := json.Unmarshal(body, &secret) + if unmarshalErr != nil { + return http.StatusBadRequest, nil, fmt.Errorf( + "error unmarshaling secret in secretPutHandler: %s", + unmarshalErr, + ) + } + + foundSecret, status, getSecretErr := getSecretWithName(c, secret.Name) + if getSecretErr != nil { + return status, nil, fmt.Errorf( + "cannot get secret with name: %s. Error: %s", + secret.Name, + getSecretErr.Error(), + ) + } + + updateSecretErr := c.SecretUpdate(context.Background(), foundSecret.ID, foundSecret.Version, swarm.SecretSpec{ + Annotations: swarm.Annotations{ + Name: secret.Name, + Labels: map[string]string{ + ownerLabel: ownerLabelValue, + }, + }, + Data: []byte(secret.Value), + }) + + if updateSecretErr != nil { + return http.StatusInternalServerError, nil, fmt.Errorf( + "couldn't update secret (name: %s, ID: %s) because of error: %s", + secret.Name, + foundSecret.ID, + updateSecretErr.Error(), + ) + } + + return http.StatusOK, nil, nil +} + func deleteSecret(c client.SecretAPIClient, body []byte) (responseStatus int, responseBody []byte, err error) { - var secret requests.Secret + var secret typesv1.Secret unmarshalErr := json.Unmarshal(body, &secret) if unmarshalErr != nil { diff --git a/handlers/secrets_test.go b/handlers/secrets_test.go index 38d92207..a39983af 100644 --- a/handlers/secrets_test.go +++ b/handlers/secrets_test.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/openfaas/faas/gateway/requests" + typesv1 "github.com/openfaas/faas-provider/types" ) func genFakeSecret(name string, data string, includeOwnerLabel bool) swarm.Secret { @@ -185,7 +185,7 @@ func Test_SecretsHandler(t *testing.T) { decoder := json.NewDecoder(resp.Body) - secretList := []requests.Secret{} + secretList := []typesv1.Secret{} err := decoder.Decode(&secretList) if err != nil { t.Error(err) diff --git a/test/info_test.go b/test/info_test.go deleted file mode 100644 index ba5a642d..00000000 --- a/test/info_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package test - -import ( - "encoding/json" - "io/ioutil" - "net/http" - "net/http/httptest" - "testing" - - typesv1 "github.com/openfaas/faas-provider/types" - - "github.com/openfaas/faas-swarm/handlers" -) - -const ( - infoTestVersion = "swarmtest" - infoTestSHA = "test" -) - -func TestMakeInfoHandler(t *testing.T) { - rr := httptest.NewRecorder() - - req, err := http.NewRequest("GET", "/system/info", nil) - if err != nil { - t.Fatal(err) - } - - handler := handlers.MakeInfoHandler(infoTestVersion, infoTestSHA) - infoRequest := typesv1.InfoRequest{} - - handler(rr, req) - body, err := ioutil.ReadAll(rr.Body) - if err != nil { - t.Fatal(err) - } - - err = json.Unmarshal(body, &infoRequest) - if err != nil { - t.Fatal(err) - } - - if required := http.StatusOK; rr.Code != required { - t.Errorf("handler returned wrong status code - want: %v, got: %v", required, rr.Code) - } - - if infoRequest.Orchestration != handlers.SwarmIdentifier { - t.Errorf("handler returned wrong orchestration - want: %v, got: %v", handlers.SwarmIdentifier, infoRequest.Orchestration) - } - - if infoRequest.Provider != handlers.SwarmProvider { - t.Errorf("handler returned wrong provider - want: %v, got: %v", handlers.SwarmProvider, infoRequest.Provider) - } - - if infoRequest.Version.Release != infoTestVersion { - t.Errorf("handler returned wrong release version - want: %v, got: %v", infoTestVersion, infoRequest.Version.Release) - } - - if infoRequest.Version.SHA != infoTestSHA { - t.Errorf("handler returned wrong SHA string - want: %v, got: %v", infoTestSHA, infoRequest.Version.SHA) - } -} diff --git a/vendor/github.com/openfaas/faas-provider/logs/handler.go b/vendor/github.com/openfaas/faas-provider/logs/handler.go index 0ab10a02..70616d82 100644 --- a/vendor/github.com/openfaas/faas-provider/logs/handler.go +++ b/vendor/github.com/openfaas/faas-provider/logs/handler.go @@ -107,6 +107,7 @@ func NewLogHandlerFunc(requestor Requester, timeout time.Duration) http.HandlerF func parseRequest(r *http.Request) (logRequest Request, err error) { query := r.URL.Query() logRequest.Name = getValue(query, "name") + logRequest.Namespace = getValue(query, "namespace") logRequest.Instance = getValue(query, "instance") tailStr := getValue(query, "tail") if tailStr != "" { diff --git a/vendor/github.com/openfaas/faas-provider/logs/logs.go b/vendor/github.com/openfaas/faas-provider/logs/logs.go index 6a48c50a..4069c405 100644 --- a/vendor/github.com/openfaas/faas-provider/logs/logs.go +++ b/vendor/github.com/openfaas/faas-provider/logs/logs.go @@ -16,6 +16,9 @@ import ( type Request struct { // Name is the function name and is required Name string `json:"name"` + // Namespace is the namespace the function is deployed to, how a namespace is defined + // is faas-provider specific + Namespace string `json:"namespace"` // Instance is the optional container name, that allows you to request logs from a specific function instance Instance string `json:"instance"` // Since is the optional datetime value to start the logs from @@ -29,13 +32,19 @@ type Request struct { // String implements that Stringer interface and prints the log Request in a consistent way that // allows you to safely compare if two requests have the same value. func (r Request) String() string { - return fmt.Sprintf("name:%s instance:%s since:%v tail:%d follow:%v", r.Name, r.Instance, r.Since, r.Tail, r.Follow) + return fmt.Sprintf( + "name:%s namespace: %s instance:%s since:%v tail:%d follow:%v", + r.Name, r.Namespace, r.Instance, r.Since, r.Tail, r.Follow, + ) } // Message is a specific log message from a function container log stream type Message struct { // Name is the function name Name string `json:"name"` + // Namespace is the namespace the function is deployed to, how a namespace is defined + // is faas-provider specific + Namespace string `json:"namespace"` // instance is the name/id of the specific function instance Instance string `json:"instance"` // Timestamp is the timestamp of when the log message was recorded @@ -46,5 +55,8 @@ type Message struct { // String implements the Stringer interface and allows for nice and simple string formatting of a log Message. func (m Message) String() string { - return fmt.Sprintf("%s %s (%s) %s", m.Timestamp.String(), m.Name, m.Instance, m.Text) + return fmt.Sprintf( + "%s %s (%s %s) %s", + m.Timestamp.String(), m.Name, m.Namespace, m.Instance, m.Text, + ) } diff --git a/vendor/github.com/openfaas/faas-provider/types/requests.go b/vendor/github.com/openfaas/faas-provider/types/requests.go index 4442ca21..bef4af41 100644 --- a/vendor/github.com/openfaas/faas-provider/types/requests.go +++ b/vendor/github.com/openfaas/faas-provider/types/requests.go @@ -8,8 +8,8 @@ type ScaleServiceRequest struct { Replicas uint64 `json:"replicas"` } -// InfoRequest provides information about the underlying provider -type InfoRequest struct { +// InfoResponse provides information about the underlying provider +type InfoResponse struct { Provider string `json:"provider"` Version ProviderVersion `json:"version"` Orchestration string `json:"orchestration"` diff --git a/vendor/github.com/openfaas/faas/LICENSE b/vendor/github.com/openfaas/faas/LICENSE deleted file mode 100644 index fc538a18..00000000 --- a/vendor/github.com/openfaas/faas/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -MIT License - -Copyright (c) 2016-2018 Alex Ellis -Copyright (c) 2018 OpenFaaS Author(s) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/github.com/openfaas/faas/gateway/requests/forward_request.go b/vendor/github.com/openfaas/faas/gateway/requests/forward_request.go deleted file mode 100644 index adc573c3..00000000 --- a/vendor/github.com/openfaas/faas/gateway/requests/forward_request.go +++ /dev/null @@ -1,29 +0,0 @@ -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) - -} diff --git a/vendor/github.com/openfaas/faas/gateway/requests/prometheus.go b/vendor/github.com/openfaas/faas/gateway/requests/prometheus.go deleted file mode 100644 index 1bb41f7b..00000000 --- a/vendor/github.com/openfaas/faas/gateway/requests/prometheus.go +++ /dev/null @@ -1,23 +0,0 @@ -// 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"` -} diff --git a/vendor/github.com/openfaas/faas/gateway/requests/requests.go b/vendor/github.com/openfaas/faas/gateway/requests/requests.go deleted file mode 100644 index 93439906..00000000 --- a/vendor/github.com/openfaas/faas/gateway/requests/requests.go +++ /dev/null @@ -1,24 +0,0 @@ -// 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"` -} - -// Secret for underlying orchestrator -type Secret struct { - Name string `json:"name"` - Value string `json:"value,omitempty"` -}