proxy

package
v0.0.0-...-70ebebb Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFunction

func DeleteFunction(gateway string, functionName string) 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 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 MakeHTTPClientWithDisableKeepAlives

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

MakeHTTPClientWithDisableKeepAlives makes a HTTP client with good defaults for timeouts.

func SetAuth

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

SetAuth sets basic auth for the given gateway

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