Documentation
¶
Overview ¶
Package functions implements serverless function management for Hanzo Base via OpenFaaS. It provides per-tenant function deployment, invocation, and lifecycle management through the Base API surface.
Example:
functions.MustRegister(app, functions.Config{
GatewayURL: "http://openfaas-gateway.hanzo.svc:8080",
FunctionNamespace: "openfaas-fn",
RegistryURL: "registry.hanzo.svc:5000",
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRegister ¶
MustRegister registers the Functions plugin and panics on failure.
Types ¶
type Config ¶
type Config struct {
// GatewayURL is the OpenFaaS gateway URL.
GatewayURL string
// FunctionNamespace is the K8s namespace for function deployments.
FunctionNamespace string
// RegistryURL is the container registry URL for function images.
RegistryURL string
}
Config holds the Functions plugin configuration.
type DeployRequest ¶
type DeployRequest struct {
Service string `json:"service"`
Image string `json:"image"`
Namespace string `json:"namespace,omitempty"`
EnvProcess string `json:"envProcess,omitempty"`
EnvVars map[string]string `json:"envVars,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
Limits *FunctionLimits `json:"limits,omitempty"`
Requests *FunctionLimits `json:"requests,omitempty"`
}
DeployRequest is the request body for deploying a function.
type FunctionLimits ¶
type FunctionLimits struct {
Memory string `json:"memory,omitempty"`
CPU string `json:"cpu,omitempty"`
}
FunctionLimits represents resource limits.
type OpenFaaSFunction ¶
type OpenFaaSFunction struct {
Name string `json:"name"`
Image string `json:"image"`
Namespace string `json:"namespace,omitempty"`
EnvProcess string `json:"envProcess,omitempty"`
EnvVars map[string]string `json:"envVars,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
Replicas int `json:"replicas,omitempty"`
InvocationCount int `json:"invocationCount,omitempty"`
AvailableReplicas int `json:"availableReplicas,omitempty"`
}
OpenFaaSFunction represents a function in OpenFaaS.
Click to show internal directories.
Click to hide internal directories.