platform

package
v0.0.0-...-f7ae98d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProjectContainsFunctions = nuclio.NewErrConflict("Project contains functions")

A project contains functions, cannot be deleted

Functions

This section is empty.

Types

type AbstractFunction

type AbstractFunction struct {
	Logger   logger.Logger
	Config   functionconfig.Config
	Status   functionconfig.Status
	Platform Platform
	// contains filtered or unexported fields
}

func NewAbstractFunction

func NewAbstractFunction(parentLogger logger.Logger,
	parentPlatform Platform,
	config *functionconfig.Config,
	status *functionconfig.Status,
	function Function) (*AbstractFunction, error)

func (*AbstractFunction) GetConfig

func (af *AbstractFunction) GetConfig() *functionconfig.Config

func (*AbstractFunction) GetExternalIPInvocationURL

func (af *AbstractFunction) GetExternalIPInvocationURL() (string, int, error)

func (*AbstractFunction) GetIngresses

func (af *AbstractFunction) GetIngresses() map[string]functionconfig.Ingress

GetIngresses returns all ingresses for this function

func (*AbstractFunction) GetInvokeURL

func (af *AbstractFunction) GetInvokeURL(InvokeViaType) (string, error)

GetInvokeURL returns the URL on which the function can be invoked

func (*AbstractFunction) GetReplicas

func (af *AbstractFunction) GetReplicas() (int, int)

GetReplicas returns the current # of replicas and the configured # of replicas

func (*AbstractFunction) GetStatus

func (af *AbstractFunction) GetStatus() *functionconfig.Status

GetState returns the state of the function

func (*AbstractFunction) GetVersion

func (af *AbstractFunction) GetVersion() string

GetVersion returns a string representing the version

func (*AbstractFunction) Initialize

func (af *AbstractFunction) Initialize([]string) error

Initialize instructs the function to load the fields specified by "fields". Some function implementations are lazy-load - this ensures that the fields are populated properly. if "fields" is nil, all fields are loaded

type AbstractFunctionEvent

type AbstractFunctionEvent struct {
	Logger              logger.Logger
	Platform            Platform
	FunctionEventConfig FunctionEventConfig
}

func NewAbstractFunctionEvent

func NewAbstractFunctionEvent(parentLogger logger.Logger,
	parentPlatform Platform,
	FunctionEventConfig FunctionEventConfig) (*AbstractFunctionEvent, error)

func (*AbstractFunctionEvent) GetConfig

func (afe *AbstractFunctionEvent) GetConfig() *FunctionEventConfig

GetConfig returns the function event config

type AbstractProject

type AbstractProject struct {
	Logger        logger.Logger
	Platform      Platform
	ProjectConfig ProjectConfig
}

func NewAbstractProject

func NewAbstractProject(parentLogger logger.Logger,
	parentPlatform Platform,
	ProjectConfig ProjectConfig) (*AbstractProject, error)

func (*AbstractProject) GetConfig

func (ap *AbstractProject) GetConfig() *ProjectConfig

GetConfig returns the project config

type Address

type Address struct {
	Address string
	Type    AddressType
}

Address

type AddressType

type AddressType int

AddressType

const (
	AddressTypeInternalIP AddressType = iota
	AddressTypeExternalIP
)

type CreateFunctionBuildOptions

type CreateFunctionBuildOptions struct {
	Logger              logger.Logger
	FunctionConfig      functionconfig.Config
	PlatformName        string
	OnAfterConfigUpdate func(*functionconfig.Config) error
	OutputImageFile     string
}

type CreateFunctionBuildResult

type CreateFunctionBuildResult struct {
	Image string

	// the function configuration read by the builder either from function.yaml or inline configuration
	UpdatedFunctionConfig functionconfig.Config
}

CreateFunctionBuildResult holds information detected/generated as a result of a build process

type CreateFunctionEventOptions

type CreateFunctionEventOptions struct {
	FunctionEventConfig FunctionEventConfig
}

type CreateFunctionInvocationOptions

type CreateFunctionInvocationOptions struct {
	Name         string
	Namespace    string
	Path         string
	Method       string
	Body         []byte
	Headers      http.Header
	LogLevelName string
	Via          InvokeViaType
}

CreateFunctionInvocationOptions is the base for all platform invoke options

type CreateFunctionInvocationResult

type CreateFunctionInvocationResult struct {
	Headers    http.Header
	Body       []byte
	StatusCode int
}

CreateFunctionInvocationResult holds the result of a single invocation

type CreateFunctionOptions

type CreateFunctionOptions struct {
	Logger               logger.Logger
	FunctionConfig       functionconfig.Config
	CreationStateUpdated chan bool
	InputImageFile       string
}

type CreateFunctionResult

type CreateFunctionResult struct {
	CreateFunctionBuildResult
	Port        int
	ContainerID string
}

CreateFunctionResult holds the results of a deploy

type CreateProjectOptions

type CreateProjectOptions struct {
	ProjectConfig ProjectConfig
}

type DeleteFunctionEventOptions

type DeleteFunctionEventOptions struct {
	Meta FunctionEventMeta
}

type DeleteFunctionOptions

type DeleteFunctionOptions struct {
	FunctionConfig functionconfig.Config
}

type DeleteProjectOptions

type DeleteProjectOptions struct {
	Meta ProjectMeta
}

type Function

type Function interface {

	// Initialize instructs the function to load the fields specified by "fields". Some function implementations
	// are lazy-load - this ensures that the fields are populated properly. if "fields" is nil, all fields
	// are loaded
	Initialize([]string) error

	// GetConfig will return the configuration of the function
	GetConfig() *functionconfig.Config

	// GetState returns the state of the function
	GetStatus() *functionconfig.Status

	// GetInvokeURL returns the URL on which the function can be invoked
	GetInvokeURL(InvokeViaType) (string, error)

	// GetReplicas returns the current # of replicas and the configured # of replicas
	GetReplicas() (int, int)

	// GetIngresses returns all ingresses for this function
	GetIngresses() map[string]functionconfig.Ingress

	// GetVersion returns a string representing the version
	GetVersion() string
}

type FunctionEvent

type FunctionEvent interface {

	// GetConfig returns the function event config
	GetConfig() *FunctionEventConfig
}

type FunctionEventConfig

type FunctionEventConfig struct {
	Meta FunctionEventMeta
	Spec FunctionEventSpec
}

type FunctionEventMeta

type FunctionEventMeta struct {
	Name        string            `json:"name,omitempty"`
	Namespace   string            `json:"namespace,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type FunctionEventSpec

type FunctionEventSpec struct {
	DisplayName string                 `json:"displayName,omitempty"`
	TriggerName string                 `json:"triggerName,omitempty"`
	TriggerKind string                 `json:"triggerKind,omitempty"`
	Body        string                 `json:"body,omitempty"`
	Attributes  map[string]interface{} `json:"attributes,omitempty"`
}

func (*FunctionEventSpec) DeepCopyInto

func (s *FunctionEventSpec) DeepCopyInto(out *FunctionEventSpec)

to appease k8s

type GetFunctionEventsOptions

type GetFunctionEventsOptions struct {
	Meta FunctionEventMeta
}

type GetFunctionsOptions

type GetFunctionsOptions struct {
	Name      string
	Namespace string
	Labels    string
}

GetFunctionsOptions is the base for all platform get options

type GetProjectsOptions

type GetProjectsOptions struct {
	Meta ProjectMeta
}

type HealthCheckMode

type HealthCheckMode string
const (

	// health check should be performed by an internal client
	HealthCheckModeInternalClient HealthCheckMode = "internalClient"

	// health check should be performed by an outside entity
	HealthCheckModeExternal = "external"
)

type InvokeViaType

type InvokeViaType int

InvokeViaType defines via which mechanism the function will be invoked

const (
	InvokeViaAny InvokeViaType = iota
	InvokeViaExternalIP
	InvokeViaLoadBalancer
	InvokeViaDomainName
)

type Node

type Node interface {

	// GetAddresses returns the list of addresses bound to the node
	GetAddresses() []Address
}

Node represents a single node in the platform

type Platform

type Platform interface {

	// Build will locally build a processor image and return its name (or the error)
	CreateFunctionBuild(createFunctionBuildOptions *CreateFunctionBuildOptions) (*CreateFunctionBuildResult, error)

	// Deploy will deploy a processor image to the platform (optionally building it, if source is provided)
	CreateFunction(createFunctionOptions *CreateFunctionOptions) (*CreateFunctionResult, error)

	// UpdateFunction will update a previously deployed function
	UpdateFunction(updateFunctionOptions *UpdateFunctionOptions) error

	// DeleteFunction will delete a previously deployed function
	DeleteFunction(deleteFunctionOptions *DeleteFunctionOptions) error

	// CreateFunctionInvocation will invoke a previously deployed function
	CreateFunctionInvocation(createFunctionInvocationOptions *CreateFunctionInvocationOptions) (*CreateFunctionInvocationResult, error)

	// GetFunctions will list existing functions
	GetFunctions(getFunctionsOptions *GetFunctionsOptions) ([]Function, error)

	// GetDefaultInvokeIPAddresses will return a list of ip addresses to be used by the platform to inovke a function
	GetDefaultInvokeIPAddresses() ([]string, error)

	// CreateProject will probably create a new project
	CreateProject(createProjectOptions *CreateProjectOptions) error

	// UpdateProject will update a previously existing project
	UpdateProject(updateProjectOptions *UpdateProjectOptions) error

	// DeleteProject will delete a previously existing project
	DeleteProject(deleteProjectOptions *DeleteProjectOptions) error

	// GetProjects will list existing projects
	GetProjects(getProjectsOptions *GetProjectsOptions) ([]Project, error)

	// CreateFunctionEvent will create a new function event that can later be used as a template from
	// which to invoke functions
	CreateFunctionEvent(createFunctionEventOptions *CreateFunctionEventOptions) error

	// UpdateFunctionEvent will update a previously existing function event
	UpdateFunctionEvent(updateFunctionEventOptions *UpdateFunctionEventOptions) error

	// DeleteFunctionEvent will delete a previously existing function event
	DeleteFunctionEvent(deleteFunctionEventOptions *DeleteFunctionEventOptions) error

	// GetFunctionEvents will list existing function events
	GetFunctionEvents(getFunctionEventsOptions *GetFunctionEventsOptions) ([]FunctionEvent, error)

	// SetExternalIPAddresses configures the IP addresses invocations will use, if "via" is set to "external-ip".
	// If this is not invoked, each platform will try to discover these addresses automatically
	SetExternalIPAddresses(externalIPAddresses []string) error

	// GetExternalIPAddresses returns the external IP addresses invocations will use, if "via" is set to "external-ip".
	// These addresses are either set through SetExternalIPAddresses or automatically discovered
	GetExternalIPAddresses() ([]string, error)

	// GetNamespaces returns all the namespaces in the platform
	GetNamespaces() ([]string, error)

	// GetHealthCheckMode returns the healthcheck mode the platform requires
	GetHealthCheckMode() HealthCheckMode

	// GetName returns the platform name
	GetName() string

	// GetNodes returns a slice of nodes currently in the cluster
	GetNodes() ([]Node, error)

	// ResolveDefaultNamespace returns the proper default resource namespace, given the current default namespace
	ResolveDefaultNamespace(string) string
}

Platform defines the interface that any underlying function platform must provide for nuclio to run over it

type Project

type Project interface {

	// GetConfig returns the project config
	GetConfig() *ProjectConfig
}

type ProjectConfig

type ProjectConfig struct {
	Meta ProjectMeta
	Spec ProjectSpec
}

type ProjectMeta

type ProjectMeta struct {
	Name        string            `json:"name,omitempty"`
	Namespace   string            `json:"namespace,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type ProjectSpec

type ProjectSpec struct {
	DisplayName string `json:"displayName,omitempty"`
	Description string `json:"description,omitempty"`
}

func (*ProjectSpec) DeepCopyInto

func (s *ProjectSpec) DeepCopyInto(out *ProjectSpec)

to appease k8s

type UpdateFunctionEventOptions

type UpdateFunctionEventOptions struct {
	FunctionEventConfig FunctionEventConfig
}

type UpdateFunctionOptions

type UpdateFunctionOptions struct {
	FunctionMeta   *functionconfig.Meta
	FunctionSpec   *functionconfig.Spec
	FunctionStatus *functionconfig.Status
}

type UpdateProjectOptions

type UpdateProjectOptions struct {
	ProjectConfig ProjectConfig
}

Directories

Path Synopsis
apis/nuclio.io/v1beta1
Package v1beta1 is the v1beta1 version of the API.
Package v1beta1 is the v1beta1 version of the API.
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/nuclio.io/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.

Jump to

Keyboard shortcuts

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