proxy

package
v0.0.0-...-8dfe6ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSecret

func CreateSecret(gateway string, secret schema.Secret, tlsInsecure bool) (int, string)

CreateSecret create secret

func DeleteFunction

func DeleteFunction(gateway string, functionName string, tlsInsecure bool) error

DeleteFunction delete a function from the FaaS server

func Deploy

func Deploy(spec *DeployFunctionSpec, update bool, warnInsecureGateway bool) (int, string)

Deploy a function to an OpenFaaS gateway over REST

func DeployFunction

func DeployFunction(spec *DeployFunctionSpec) int

DeployFunction first tries to deploy a function and if it exists will then attempt a rolling update. Warnings are suppressed for the second API call (if required.)

func GetFunctionInfo

func GetFunctionInfo(gateway string, functionName string, tlsInsecure bool) (requests.Function, error)

GetFunctionInfo get an OpenFaaS function information

func GetSecretList

func GetSecretList(gateway string, tlsInsecure bool) ([]schema.Secret, error)

GetSecretList get secrets list

func GetSystemInfo

func GetSystemInfo(gateway string, tlsInsecure bool) (map[string]interface{}, error)

GetSystemInfo get system information from /system/info endpoint

func InvokeFunction

func InvokeFunction(gateway string, name string, bytesIn *[]byte, contentType string, query []string, headers []string, async bool, httpMethod string, tlsInsecure bool) (*[]byte, error)

InvokeFunction a function

func ListFunctions

func ListFunctions(gateway string, tlsInsecure bool) ([]requests.Function, error)

ListFunctions list deployed functions

func MakeHTTPClient

func MakeHTTPClient(timeout *time.Duration, tlsInsecure bool) http.Client

MakeHTTPClient makes a HTTP client with good defaults for timeouts.

func RemoveSecret

func RemoveSecret(gateway string, secret schema.Secret, tlsInsecure bool) error

RemoveSecret remove a secret via the OpenFaaS API by name

func SetAuth

func SetAuth(req *http.Request, gateway string)

SetAuth sets basic auth for the given gateway

func UpdateSecret

func UpdateSecret(gateway string, secret schema.Secret, tlsInsecure bool) (int, string)

UpdateSecret update a secret via the OpenFaaS API by name

Types

type DeployFunctionSpec

type DeployFunctionSpec struct {
	FProcess                string
	Gateway                 string
	FunctionName            string
	Image                   string
	RegistryAuth            string
	Language                string
	Replace                 bool
	EnvVars                 map[string]string
	Network                 string
	Constraints             []string
	Update                  bool
	Secrets                 []string
	Labels                  map[string]string
	Annotations             map[string]string
	FunctionResourceRequest FunctionResourceRequest
	ReadOnlyRootFilesystem  bool
	TLSInsecure             bool
}

DeployFunctionSpec defines the spec used when deploying a function

type FunctionResourceRequest

type FunctionResourceRequest struct {
	Limits   *stack.FunctionResources
	Requests *stack.FunctionResources
}

FunctionResourceRequest defines a request to set function resources

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL