Documentation ¶
Index ¶
- Variables
- func MakeDelete(sr consul.ServiceResolver, client nomad.Job, logger hclog.Logger, ...) http.HandlerFunc
- func MakeDeploy(client nomad.Job, providerConfig types.ProviderConfig, logger hclog.Logger, ...) http.HandlerFunc
- func MakeExtractFunctionMiddleWare(getVars func(*http.Request) map[string]string, next http.HandlerFunc) http.HandlerFunc
- func MakeHealthHandler() http.HandlerFunc
- func MakeInfo(logger hclog.Logger, stats metrics.StatsD, version string) http.HandlerFunc
- func MakeProxy(config ProxyConfig) http.HandlerFunc
- func MakeReader(client nomad.Job, logger hclog.Logger, stats metrics.StatsD) http.HandlerFunc
- func MakeReplicationReader(client nomad.Job, logger hclog.Logger, stats metrics.StatsD) http.HandlerFunc
- func MakeReplicationWriter(client nomad.Job, logger hclog.Logger, stats metrics.StatsD) http.HandlerFunc
- func MakeSecretHandler(vs *vault.VaultService, log hclog.Logger) http.HandlerFunc
- type HTTPProxyClient
- type MockProxyClient
- type Proxy
- type ProxyClient
- type ProxyConfig
- type SecretsResponse
Constants ¶
This section is empty.
Variables ¶
var FunctionNameCTXKey = struct{}{}
FunctionNameCTXKey is a context key which points to the location of the function name set bu the ExtractFunction middleware
Functions ¶
func MakeDelete ¶
func MakeDelete(sr consul.ServiceResolver, client nomad.Job, logger hclog.Logger, stats metrics.StatsD) http.HandlerFunc
MakeDelete creates a handler for deploying functions
func MakeDeploy ¶
func MakeDeploy(client nomad.Job, providerConfig types.ProviderConfig, logger hclog.Logger, stats metrics.StatsD) http.HandlerFunc
MakeDeploy creates a handler for deploying functions
func MakeExtractFunctionMiddleWare ¶
func MakeExtractFunctionMiddleWare( getVars func(*http.Request) map[string]string, next http.HandlerFunc) http.HandlerFunc
MakeExtractFunctionMiddleWare returns a middleware handler which validates the presence of the function name in the URI query.
func MakeHealthHandler ¶ added in v0.2.27
func MakeHealthHandler() http.HandlerFunc
MakeHealthHandler returns 200/OK when healthy
func MakeProxy ¶
func MakeProxy(config ProxyConfig) http.HandlerFunc
MakeProxy creates a proxy for HTTP web requests which can be routed to a function.
func MakeReader ¶
MakeReader implements the OpenFaaS reader handler
func MakeReplicationReader ¶
func MakeReplicationReader(client nomad.Job, logger hclog.Logger, stats metrics.StatsD) http.HandlerFunc
MakeReplicationReader creates a replication reader handler
func MakeReplicationWriter ¶
func MakeReplicationWriter(client nomad.Job, logger hclog.Logger, stats metrics.StatsD) http.HandlerFunc
MakeReplicationWriter creates a handler for scaling functions
func MakeSecretHandler ¶ added in v0.4.0
func MakeSecretHandler(vs *vault.VaultService, log hclog.Logger) http.HandlerFunc
Types ¶
type HTTPProxyClient ¶
type HTTPProxyClient struct {
// contains filtered or unexported fields
}
HTTPProxyClient allows the calling of functions
func MakeProxyClient ¶
func MakeProxyClient(timeout time.Duration, l hclog.Logger) *HTTPProxyClient
MakeProxyClient creates a new HTTPProxyClient
func (*HTTPProxyClient) CallAndReturnResponse ¶
func (pc *HTTPProxyClient) CallAndReturnResponse(address string, body []byte, headers http.Header) ( []byte, http.Header, int, error)
CallAndReturnResponse calls the function and returns the response
func (*HTTPProxyClient) GetFunctionName ¶
func (pc *HTTPProxyClient) GetFunctionName(r *http.Request) string
GetFunctionName returns the name of the function from the request vars
type MockProxyClient ¶
MockProxyClient is a mock implementation of the ProxyClient
func (*MockProxyClient) CallAndReturnResponse ¶
func (mp *MockProxyClient) CallAndReturnResponse(address string, body []byte, h http.Header) ( []byte, http.Header, int, error)
CallAndReturnResponse returns a mock response
func (*MockProxyClient) GetFunctionName ¶
func (mp *MockProxyClient) GetFunctionName(r *http.Request) string
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is a http.Handler which implements the ability to call a downstream function
type ProxyClient ¶
type ProxyClient interface { GetFunctionName(*http.Request) string CallAndReturnResponse(address string, body []byte, headers http.Header) ([]byte, http.Header, int, error) }
ProxyClient defines the interface for a client which calls faas functions
type ProxyConfig ¶ added in v0.2.23
type ProxyConfig struct { Client ProxyClient Resolver consul.ServiceResolver Logger hclog.Logger StatsD *statsd.Client Timeout time.Duration }