platform

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractPlatform

type AbstractPlatform struct {
	Logger nuclio.Logger
	// contains filtered or unexported fields
}

func NewAbstractPlatform

func NewAbstractPlatform(parentLogger nuclio.Logger, platform Platform) (*AbstractPlatform, error)

func (*AbstractPlatform) BuildFunction

func (ap *AbstractPlatform) BuildFunction(buildOptions *BuildOptions) (string, error)

func (*AbstractPlatform) GetDeployRequiresRegistry

func (ap *AbstractPlatform) GetDeployRequiresRegistry() bool

GetDeployRequiresRegistry returns true if a registry is required for deploy, false otherwise

func (*AbstractPlatform) HandleDeployFunction

func (ap *AbstractPlatform) HandleDeployFunction(deployOptions *DeployOptions,
	deployer func() (*DeployResult, error)) (*DeployResult, error)

HandleDeployFunction calls a deployer that does the platform specific deploy, but adds a lot of common code

func (*AbstractPlatform) InvokeFunction

func (ap *AbstractPlatform) InvokeFunction(invokeOptions *InvokeOptions, writer io.Writer) error

InvokeFunction will invoke a previously deployed function

type BuildOptions

type BuildOptions struct {
	Common           *CommonOptions
	Path             string
	OutputType       string
	NuclioSourceDir  string
	NuclioSourceURL  string
	Registry         string
	ImageName        string
	ImageVersion     string
	Runtime          string
	NoBaseImagesPull bool

	// platform specific
	Platform interface{}
}

BuildOptions is the base for all platform build options

func (*BuildOptions) InitDefaults

func (bo *BuildOptions) InitDefaults()

InitDefaults will initialize field values to a given default

type CommonOptions

type CommonOptions struct {
	Logger     nuclio.Logger
	Verbose    bool
	Identifier string
	Namespace  string

	// platform specific configuration
	PlatformConfiguration interface{}
}

CommonOptions is the base for all platform options. It's never instantiated directly

func (*CommonOptions) GetLogger

func (co *CommonOptions) GetLogger(defaultLogger nuclio.Logger) nuclio.Logger

GetLogger returns the common.Logger if it's valid, or defaultLogger if it's not

func (*CommonOptions) InitDefaults

func (co *CommonOptions) InitDefaults()

InitDefaults will initialize field values to a given default

type DataBinding

type DataBinding struct {
	Name    string            `json:"name"`
	Class   string            `json:"class"`
	URL     string            `json:"url"`
	Path    string            `json:"path,omitempty"`
	Query   string            `json:"query,omitempty"`
	Secret  string            `json:"secret,omitempty"`
	Options map[string]string `json:"options,omitempty"`
}

DataBinding holds configuration for a databinding

type DeleteOptions

type DeleteOptions struct {
	Common *CommonOptions
}

DeleteOptions is the base for all platform delete options

type DeployOptions

type DeployOptions struct {
	Common       *CommonOptions
	Build        BuildOptions
	ImageName    string
	SpecPath     string
	Description  string
	Env          string
	Labels       string
	CPU          string
	Memory       string
	WorkDir      string
	Role         string
	Secret       string
	Events       string
	Data         string
	Disabled     bool
	Publish      bool
	HTTPPort     int32
	Scale        string
	MinReplicas  int32
	MaxReplicas  int32
	RunRegistry  string
	DataBindings map[string]DataBinding

	// platform specific
	Platform interface{}
}

DeployOptions is the base for all platform deploy options

func (*DeployOptions) InitDefaults

func (do *DeployOptions) InitDefaults()

InitDefaults will initialize field values to a given default

type DeployResult

type DeployResult struct {
	Port int
}

DeployResult holds the results of a deploy

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

	// GetNamespace returns the namespace of the function, if its part of a namespace
	GetNamespace() string

	// GetName returns the name of the function
	GetName() string

	// GetVersion returns the version of the function
	GetVersion() string

	// GetState returns the state of the function
	GetState() string

	// GetHTTPPort returns the port of the HTTP event source
	GetHTTPPort() int

	// GetLabels returns the function labels
	GetLabels() map[string]string

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

	// GetClusterIP gets the IP of the cluster hosting the function
	GetClusterIP() string
}

type GetOptions

type GetOptions struct {
	Common  *CommonOptions
	NotList bool
	Watch   bool
	Labels  string
	Format  string
}

GetOptions is the base for all platform get options

type InvokeOptions

type InvokeOptions struct {
	Common       *CommonOptions
	ClusterIP    string
	ContentType  string
	URL          string
	Method       string
	Body         string
	Headers      string
	LogLevelName string
}

InvokeOptions is the base for all platform invoke options

type Platform

type Platform interface {

	// Build will locally build a processor image and return its name (or the error)
	BuildFunction(buildOptions *BuildOptions) (string, error)

	// Deploy will deploy a processor image to the platform (optionally building it, if source is provided)
	DeployFunction(deployOptions *DeployOptions) (*DeployResult, error)

	// InvokeFunction will invoke a previously deployed function
	InvokeFunction(invokeOptions *InvokeOptions, writer io.Writer) error

	// InvokeFunction will invoke a previously deployed function
	GetFunctions(getOptions *GetOptions) ([]Function, error)

	// UpdateOptions will update a previously deployed function
	UpdateFunction(updateOptions *UpdateOptions) error

	// DeleteFunction will delete a previously deployed function
	DeleteFunction(deleteOptions *DeleteOptions) error

	// GetDeployRequiresRegistry returns true if a registry is required for deploy, false otherwise
	GetDeployRequiresRegistry() bool

	// GetName returns the platform name
	GetName() string
}

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

type UpdateOptions

type UpdateOptions struct {
	Common *CommonOptions
	Deploy DeployOptions
	Alias  string
}

UpdateOptions is the base for all platform update options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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