Documentation
¶
Index ¶
- func AsyncInvoke(functionName string, id string) error
- func FastAsyncInvoke(next http.HandlerFunc, r *http.Request) error
- func Invoke(next http.HandlerFunc, w http.ResponseWriter, r *http.Request) error
- func MakeQueuedProxy(metrics metrics.MetricOptions, wildcard bool, ...) http.HandlerFunc
- func MakeRealtimeAsyncInvokeHandler(next http.HandlerFunc) http.HandlerFunc
- func MakeRealtimeDeleteHandler(ac AdmissionControl, proxy *types.HTTPClientReverseProxy, ...) http.HandlerFunc
- func MakeRealtimeDeployHandler(ac AdmissionControl, proxy *types.HTTPClientReverseProxy, ...) http.HandlerFunc
- func MakeRealtimeInvokeHandler(next http.HandlerFunc) http.HandlerFunc
- func MakeRealtimeUpdateHandler(ac AdmissionControl, proxy *types.HTTPClientReverseProxy, ...) http.HandlerFunc
- func RemoveFunctionHandler(functionName string)
- func SetFunctionHandler(f requests.CreateFunctionRequest)
- type AdmissionControl
- type Invocation
- type InvocationHandler
- type ReserveAdmissionControl
- func (ac ReserveAdmissionControl) Register(w http.ResponseWriter, r *http.Request, proxyClient *http.Client, ...) (int, error)
- func (ac ReserveAdmissionControl) Unregister(w http.ResponseWriter, r *http.Request, proxyClient *http.Client, ...) (int, error)
- func (ac ReserveAdmissionControl) Update(w http.ResponseWriter, r *http.Request, proxyClient *http.Client, ...) (int, error)
- type ResourceManager
- func (rm ResourceManager) CreateImage(r *http.Request, proxyClient *http.Client, baseURL string, requestURL string, ...) (*http.Response, error)
- func (rm ResourceManager) GetAvailReplicas(functionName string) (uint64, error)
- func (rm ResourceManager) GetCPUQuantity(str string) (int64, error)
- func (rm ResourceManager) GetDeploymentParams(functionName string) (scaling.ServiceQueryResponse, error)
- func (rm ResourceManager) GetMemoryQuantity(str string) (int64, error)
- func (rm ResourceManager) GetResourceQuantity(req requests.FunctionResources) (int64, int64, error)
- func (rm ResourceManager) PackageRequest(cfr requests.CreateFunctionRequest, req *http.Request) error
- func (rm ResourceManager) ParseRequest(req *http.Request) (requests.CreateFunctionRequest, error)
- func (rm ResourceManager) RemoveImage(r *http.Request, proxyClient *http.Client, baseURL string, requestURL string, ...) (*http.Response, error)
- func (rm ResourceManager) Scale(functionName string, realtimeReplicas uint64) error
- func (rm ResourceManager) SetSandboxResources(request *requests.CreateFunctionRequest, cpu int64, memory int64)
- func (rm ResourceManager) UpdateImage(r *http.Request, proxyClient *http.Client, baseURL string, requestURL string, ...) (*http.Response, error)
- func (rm ResourceManager) WaitForAvailReplicas(functionName string, expectedReplicas uint64, retry uint64, interval int) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsyncInvoke ¶
func FastAsyncInvoke ¶
func FastAsyncInvoke(next http.HandlerFunc, r *http.Request) error
Bypassing queue worker
func Invoke ¶
func Invoke(next http.HandlerFunc, w http.ResponseWriter, r *http.Request) error
Invoke execute a deployed function
func MakeQueuedProxy ¶
func MakeQueuedProxy(metrics metrics.MetricOptions, wildcard bool, canQueueRequests queue.CanQueueRequests, pathTransformer handlers.URLPathTransformer) http.HandlerFunc
MakeQueuedProxy accepts work onto a queue
func MakeRealtimeAsyncInvokeHandler ¶
func MakeRealtimeAsyncInvokeHandler(next http.HandlerFunc) http.HandlerFunc
func MakeRealtimeDeleteHandler ¶
func MakeRealtimeDeleteHandler( ac AdmissionControl, proxy *types.HTTPClientReverseProxy, notifiers []handlers.HTTPNotifier, baseURLResolver handlers.BaseURLResolver, urlPathTransformer handlers.URLPathTransformer) http.HandlerFunc
Forward the delete request to the backend.
func MakeRealtimeDeployHandler ¶
func MakeRealtimeDeployHandler( ac AdmissionControl, proxy *types.HTTPClientReverseProxy, notifiers []handlers.HTTPNotifier, baseURLResolver handlers.BaseURLResolver, urlPathTransformer handlers.URLPathTransformer) http.HandlerFunc
Forward the deploy request to the backend.
func MakeRealtimeInvokeHandler ¶
func MakeRealtimeInvokeHandler(next http.HandlerFunc) http.HandlerFunc
func MakeRealtimeUpdateHandler ¶
func MakeRealtimeUpdateHandler( ac AdmissionControl, proxy *types.HTTPClientReverseProxy, notifiers []handlers.HTTPNotifier, baseURLResolver handlers.BaseURLResolver, urlPathTransformer handlers.URLPathTransformer) http.HandlerFunc
Forward the update request to the backend.
func RemoveFunctionHandler ¶
func RemoveFunctionHandler(functionName string)
func SetFunctionHandler ¶
func SetFunctionHandler(f requests.CreateFunctionRequest)
SetFunctionHandler create handler for a new function or update an existing one
Types ¶
type AdmissionControl ¶
type AdmissionControl interface { Register( w http.ResponseWriter, r *http.Request, proxyClient *http.Client, baseURL string, requestURL string, timeout time.Duration, writeRequestURI bool) (int, error) Update( w http.ResponseWriter, r *http.Request, proxyClient *http.Client, baseURL string, requestURL string, timeout time.Duration, writeRequestURI bool) (int, error) Unregister( w http.ResponseWriter, r *http.Request, proxyClient *http.Client, baseURL string, requestURL string, timeout time.Duration, writeRequestURI bool) (int, error) }
type Invocation ¶
type Invocation struct {
// contains filtered or unexported fields
}
Invocation holds information of pending requests
type InvocationHandler ¶
type InvocationHandler struct { // Channel for pending invocations SyncInvs chan Invocation AsyncInvs chan Invocation Realtime float64 AsyncWait sync.Map //FreeAsync int32 Timing *time.Ticker Stop chan bool Update chan bool BufferSize int Idle chan bool AvailSlots chan int }
InvocationHandler process new invocations
type ReserveAdmissionControl ¶
type ReserveAdmissionControl struct { }
func (ReserveAdmissionControl) Unregister ¶
type ResourceManager ¶
type ResourceManager struct{}
func (ResourceManager) CreateImage ¶
func (ResourceManager) GetAvailReplicas ¶
func (rm ResourceManager) GetAvailReplicas(functionName string) (uint64, error)
Check if available replicas meet expect ones
func (ResourceManager) GetCPUQuantity ¶
func (rm ResourceManager) GetCPUQuantity(str string) (int64, error)
GetCPUQuantity returns CPU quantity as number
func (ResourceManager) GetDeploymentParams ¶
func (rm ResourceManager) GetDeploymentParams(functionName string) (scaling.ServiceQueryResponse, error)
GetDeploymentParams returns deployment params of a registered function
func (ResourceManager) GetMemoryQuantity ¶
func (rm ResourceManager) GetMemoryQuantity(str string) (int64, error)
GetMemoryQuantity returns memory quantity as number
func (ResourceManager) GetResourceQuantity ¶
func (rm ResourceManager) GetResourceQuantity(req requests.FunctionResources) (int64, int64, error)
func (ResourceManager) PackageRequest ¶
func (rm ResourceManager) PackageRequest(cfr requests.CreateFunctionRequest, req *http.Request) error
PackageRequest reformats the request into the form understandable by the underlying system and write to the http request
func (ResourceManager) ParseRequest ¶
func (rm ResourceManager) ParseRequest(req *http.Request) (requests.CreateFunctionRequest, error)
ParseRequest returns a CreateFunctionRequest that hold all needed information about function deployment/update
func (ResourceManager) RemoveImage ¶
func (ResourceManager) Scale ¶
func (rm ResourceManager) Scale(functionName string, realtimeReplicas uint64) error
Scale a function by either increasing or decreasing its replicas
func (ResourceManager) SetSandboxResources ¶
func (rm ResourceManager) SetSandboxResources(request *requests.CreateFunctionRequest, cpu int64, memory int64)
Reserve resource for realtime deployment
func (ResourceManager) UpdateImage ¶
func (ResourceManager) WaitForAvailReplicas ¶
func (rm ResourceManager) WaitForAvailReplicas( functionName string, expectedReplicas uint64, retry uint64, interval int) bool
Wait until a given function has sufficient replicas or timeout determined by retry*interval