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