functioncr

package
v0.0.0-...-2f10389 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSpecFile

func FromSpecFile(specFilePath string, f *Function) error

func GetVersionSeparator

func GetVersionSeparator() string

func WaitConditionProcessed

func WaitConditionProcessed(functioncrInstance *Function) (bool, error)

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 NewClient

func NewClient(parentLogger nuclio.Logger,
	restConfig *rest.Config,
	clientSet *kubernetes.Clientset) (*Client, error)

func (*Client) Create

func (c *Client) Create(function *Function) (*Function, error)

func (*Client) CreateResource

func (c *Client) CreateResource() error

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 (c *Client) DeleteResource() error

func (*Client) Get

func (c *Client) Get(namespace, name string) (*Function, error)

func (*Client) List

func (c *Client) List(namespace string, options *meta_v1.ListOptions) (*FunctionList, error)

func (*Client) Update

func (c *Client) Update(function *Function) (*Function, error)

func (*Client) WaitForResource

func (c *Client) WaitForResource() error

func (*Client) WaitUntilCondition

func (c *Client) WaitUntilCondition(namespace, name string, condition func(*Function) (bool, error), timeout time.Duration) error

func (*Client) WatchForChanges

func (c *Client) WatchForChanges(namespace string, changeChan chan Change) (*Watcher, error)

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) GetLabels

func (f *Function) GetLabels() map[string]string

func (*Function) GetNameAndVersion

func (f *Function) GetNameAndVersion() (name string, version *int, err error)

func (*Function) GetNamespacedName

func (f *Function) GetNamespacedName() string

func (*Function) SetDefaults

func (f *Function) SetDefaults()

func (*Function) SetStatus

func (f *Function) SetStatus(state FunctionState, message string)

type FunctionCode

type FunctionCode struct {
	Path   string `json:"path,omitempty"`
	Key    string `json:"key,omitempty"`
	Code   string `json:"code,omitempty"`
	Watch  bool   `json:"watch,omitempty"`
	Inline string `json:"inline,omitempty"`
}

type FunctionList

type FunctionList struct {
	meta_v1.TypeMeta `json:",inline"`
	meta_v1.ListMeta `json:"metadata"`
	Items            []Function `json:"items"`
}

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"`
}

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL