Documentation
¶
Index ¶
Constants ¶
View Source
const ( // State value of FaaSFunction FailedState State = "failed" InitialState State = "initial" ActiveState State = "active" InactiveState State = "inactive" // only for keep fsm working DestroyedState State = "destroyed" // Function event invoked by APIs. CreateEvent Event = "create" StartEvent Event = "start" StopEvent Event = "stop" UpdateEvent Event = "update" DeleteEvent Event = "delete" // Function Event invoked by FaaSProvider ReadyEvent Event = "ready" PendingEvent Event = "pending" ErrorEvent Event = "error" )
View Source
const ( AutoScaleMetricCPU = "cpu" AutoScaleMetricConcurrency = "concurrency" AutoScaleMetricRPS = "rps" // ProviderKnative is the faas provider Knative. ProviderKnative = "knative" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct {
// SyncInterval is the interval for reconciling local FaaSFunction state and FaaSProvider's.
SyncInterval string `yaml:"syncInterval" jsonschema:"required,format=duration"`
// Provider is the FaaSProvider.
Provider string `yaml:"provider" jsonschema:"required"`
// HTTPServer is the HTTP traffic gate for accepting ingress traffic.
HTTPServer *httpserver.Spec `yaml:"httpServer" jsonschema:"required"`
// Currently we only supports knative type faas provider, so this filed should be
// "required" right now.
Knative *Knative `yaml:"knative" jsonschema:"required"`
}
Admin describes the Function.
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
functionFSM is a finite state machine for managing faas function.
type Function ¶
type Function struct {
Spec *Spec `yaml:"spec" jsonschema:"required"`
Status *Status `yaml:"status" jsonschema:"required"`
Fsm *FSM `yaml:"fsm" jsonschema:"omitempty"`
}
Function contains the FaaSFunction's spec ,runtime status with a build-in fsm.
type Knative ¶
type Knative struct {
HostSuffix string `yaml:"hostSuffix" jsonschema:"required"`
NetworkLayerURL string `yaml:"networkLayerURL" jsonschema:"required,format=uri"`
Namespace string `yaml:"namespace" jsonschema:"omitempty"`
Timeout string `yaml:"timeout" jsonschema:"omitempty,format=duration"`
}
Knative is the faas provider Knative.
type Spec ¶
type Spec struct {
Name string `yaml:"name" jsonschema:"required"`
Image string `yaml:"image" jsonschema:"required"`
Port int `yaml:"port" jsonschema:"omitempty"`
AutoScaleType string `yaml:"autoScaleType" jsonschema:"required"`
AutoScaleValue string `yaml:"autoScaleValue" jsonschema:"required"`
MinReplica int `yaml:"minReplica" jsonschema:"omitempty"`
MaxReplica int `yaml:"maxReplica" jsonschema:"omitempty"`
LimitCPU string `yaml:"limitCPU" jsonschema:"omitempty"`
LimitMemory string `yaml:"limitMemory" jsonschema:"omitempty"`
RequestCPU string `yaml:"requestCPU" jsonschema:"omitempty"`
RequestMemory string `yaml:"requestMemory" jsonschema:"omitempty"`
RequestAdaptor *requestadaptor.Spec `yaml:"requestAdaptor" jsonschema:"required"`
}
Spec is the spec of FaaSFunction.
Click to show internal directories.
Click to hide internal directories.