Documentation ¶
Index ¶
- func FromSpecFile(specFilePath string, f *Function) error
- func GetVersionSeparator() string
- func WaitConditionProcessed(functioncrInstance *Function) (bool, error)
- type BuildState
- type Change
- type ChangeKind
- type Client
- func (c *Client) Create(function *Function) (*Function, error)
- func (c *Client) CreateResource() error
- func (c *Client) Delete(namespace, name string, options *meta_v1.DeleteOptions) error
- func (c *Client) DeleteResource() error
- func (c *Client) Get(namespace, name string) (*Function, error)
- func (c *Client) List(namespace string, options *meta_v1.ListOptions) (*FunctionList, error)
- func (c *Client) Update(function *Function) (*Function, error)
- func (c *Client) WaitForResource() error
- func (c *Client) WaitUntilCondition(namespace, name string, condition func(*Function) (bool, error), ...) error
- func (c *Client) WatchForChanges(namespace string, changeChan chan Change) (*Watcher, error)
- type Function
- type FunctionCode
- type FunctionList
- type FunctionSpec
- type FunctionState
- type FunctionStatus
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromSpecFile ¶
func GetVersionSeparator ¶
func GetVersionSeparator() string
func WaitConditionProcessed ¶
returns true if function was processed
Types ¶
type BuildState ¶
type BuildState string
const ( BuildStateUnknown BuildState = "" BuildStatePending BuildState = "pending" BuildStateError BuildState = "error" BuildStateBuild BuildState = "build" BuildStateReady BuildState = "ready" )
type Change ¶
type Change struct { Kind ChangeKind Function *Function PreviousFunction *Function // applicable only in updated }
type ChangeKind ¶
type ChangeKind int
const ( ChangeKindAdded ChangeKind = iota ChangeKindUpdated ChangeKindDeleted )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateResource ¶
registers the "class" into k8s (CRDs are not namespaced)
func (*Client) Delete ¶
func (c *Client) Delete(namespace, name string, options *meta_v1.DeleteOptions) error
func (*Client) DeleteResource ¶
func (*Client) List ¶
func (c *Client) List(namespace string, options *meta_v1.ListOptions) (*FunctionList, error)
func (*Client) WaitForResource ¶
func (*Client) WaitUntilCondition ¶
type Function ¶
type Function struct { meta_v1.TypeMeta `json:",inline"` meta_v1.ObjectMeta `json:"metadata"` Spec FunctionSpec `json:"spec"` Status FunctionStatus `json:"status,omitempty"` }
func (*Function) GetNameAndVersion ¶
func (*Function) GetNamespacedName ¶
func (*Function) SetDefaults ¶
func (f *Function) SetDefaults()
func (*Function) SetStatus ¶
func (f *Function) SetStatus(state FunctionState, message string)
type FunctionCode ¶
type FunctionList ¶
type FunctionSpec ¶
type FunctionSpec struct { Version int `json:"version,omitempty"` Description string `json:"description,omitempty"` Disabled bool `json:"disable,omitempty"` Publish bool `json:"publish,omitempty"` Alias string `json:"alias,omitempty"` Handler string `json:"handler,omitempty"` Runtime string `json:"runtime,omitempty"` WorkingDir string `json:"workingDir,omitempty"` Env []v1.EnvVar `json:"env,omitempty"` Resources v1.ResourceRequirements `json:"resources,omitempty"` DlqStream string `json:"dlqStream,omitempty"` Role string `json:"role,omitempty"` Secret string `json:"secret,omitempty"` Image string `json:"image,omitempty"` Code FunctionCode `json:"code,omitempty"` NetPolicy string `json:"netPolicy,omitempty"` LogLevel string `json:"logLevel,omitempty"` Replicas int32 `json:"replicas,omitempty"` MinReplicas int32 `json:"minReplicas,omitempty"` MaxReplicas int32 `json:"maxReplicas,omitempty"` DataBindings map[string]platform.DataBinding `json:"dataBindings,omitempty"` HTTPPort int32 `json:"httpPort,omitempty"` }
type FunctionState ¶
type FunctionState string
const ( FunctionStateCreated FunctionState = "" FunctionStateProcessed FunctionState = "processed" FunctionStateError FunctionState = "error" FunctionStateDisabled FunctionState = "disabled" FunctionStateTerminate FunctionState = "terminate" )
type FunctionStatus ¶
type FunctionStatus struct { State FunctionState `json:"state,omitempty"` Message string `json:"message,omitempty"` BuildState BuildState `json:"build,omitempty"` ObservedGen string `json:"observedVer,omitempty"` }
Click to show internal directories.
Click to hide internal directories.