platforms

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Properties struct {
	Cert       string
	Key        string
	Auth       string
	APIHost    string
	APIVersion string
	APIBuild   string
	APIBuildNo string
	CLIVersion string
	Namespace  string
	PropsFile  string
}

Functions

func ActionName

func ActionName() string

func ContainerName

func ContainerName() string

func NewQualifiedNameError

func NewQualifiedNameError(entityName string, err error) error

NewQualifiedNameError(entityName, err) returns specific whisk error

for invalid qualified names.

func RandomStringWithCharset added in v0.2.1

func RandomStringWithCharset(length int, charset string) string

func ScaleMemory

func ScaleMemory(memory int) falco.ScaleOptions

Types

type DockerDeployment

type DockerDeployment struct {
	ContainerID string
	// contains filtered or unexported fields
}

func (DockerDeployment) DeploymentID added in v0.2.1

func (d DockerDeployment) DeploymentID() string

type InitMessage

type InitMessage struct {
	Name   string            `json:"name"`
	Main   string            `json:"main"`
	Code   string            `json:"code"`
	Binary bool              `json:"binary"`
	Env    map[string]string `json:"env"`
}

type OpenWhisk

type OpenWhisk struct {
	Host    string
	Token   string
	Verbose bool

	BACKOFF time.Duration
	// contains filtered or unexported fields
}

OpenWhisk implements an AsyncPlatform for OpenWhisk v1.1

func NewOpenWhisk

func NewOpenWhisk(options ...OpenWhiskOption) (*OpenWhisk, error)

func (*OpenWhisk) Apply

func (ow *OpenWhisk) Apply(opt OpenWhiskOption)

func (*OpenWhisk) Collect

func (ow *OpenWhisk) Collect(job *falco.AsyncInvocationPhase, activations <-chan falco.Invocation,
	options ...falco.InvocableOptions) error

func (*OpenWhisk) Deploy

func (ow *OpenWhisk) Deploy(deployable falco.Deployable) (falco.Deployment, error)

func (*OpenWhisk) FetchActivationLog added in v0.2.1

func (ow *OpenWhisk) FetchActivationLog(deployment falco.Deployment, invocation falco.Invocation) map[string]interface{}

func (*OpenWhisk) FetchDeployment added in v0.2.1

func (ow *OpenWhisk) FetchDeployment(actionName string) (falco.Deployment, error)

func (*OpenWhisk) Invoke

func (ow *OpenWhisk) Invoke(deployment falco.Deployment, payload falco.Invocation) (falco.Invocation, error)

func (*OpenWhisk) Remove

func (ow *OpenWhisk) Remove(deployment falco.Deployment) error

func (*OpenWhisk) Scale

func (ow *OpenWhisk) Scale(deployment falco.Deployment, options ...falco.ScaleOptions) (falco.Deployment, error)

func (*OpenWhisk) Submit

func (ow *OpenWhisk) Submit(job *falco.AsyncInvocationPhase, target falco.Deployment, payload falco.Invocation,
	activationQueue chan<- falco.Invocation, options ...falco.InvocableOptions) error

type OpenWhiskDeployment

type OpenWhiskDeployment struct {
	ActionName string
	Memory     int
	// contains filtered or unexported fields
}

func (OpenWhiskDeployment) DeploymentID added in v0.2.1

func (o OpenWhiskDeployment) DeploymentID() string

type OpenWhiskDockerRunner

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

OpenWhiskDockerRunner implement a AsyncPlatfrom using the OpenWhisk docker runtime. This will create a single docker container for your runtime and use the OpenWhisk runtime api to perfrom deployment and invocations.

func NewOpenWhiskDockerRunner

func NewOpenWhiskDockerRunner(ctx context.Context) *OpenWhiskDockerRunner

func (OpenWhiskDockerRunner) Collect added in v0.2.1

func (o OpenWhiskDockerRunner) Collect(job *falco.AsyncInvocationPhase,
	activations <-chan falco.Invocation, options ...falco.InvocableOptions) error

func (OpenWhiskDockerRunner) Deploy

func (o OpenWhiskDockerRunner) Deploy(deployable falco.Deployable) (falco.Deployment, error)

func (OpenWhiskDockerRunner) FetchActivationLog added in v0.2.1

func (o OpenWhiskDockerRunner) FetchActivationLog(deployment falco.Deployment, invocation falco.Invocation) map[string]interface{}

func (OpenWhiskDockerRunner) FetchDeployment added in v0.2.1

func (o OpenWhiskDockerRunner) FetchDeployment(deplotmentID string) (falco.Deployment, error)

func (OpenWhiskDockerRunner) Invoke

func (o OpenWhiskDockerRunner) Invoke(deployment falco.Deployment, payload falco.Invocation) (falco.Invocation, error)

func (OpenWhiskDockerRunner) Remove

func (o OpenWhiskDockerRunner) Remove(deployment falco.Deployment) error

func (OpenWhiskDockerRunner) Scale

func (o OpenWhiskDockerRunner) Scale(deployment falco.Deployment, options ...falco.ScaleOptions) (falco.Deployment, error)

Not available in docker (in this case)

func (OpenWhiskDockerRunner) Submit added in v0.2.1

func (o OpenWhiskDockerRunner) Submit(job *falco.AsyncInvocationPhase, deployment falco.Deployment,
	payload falco.Invocation, invocations chan<- falco.Invocation, options ...falco.InvocableOptions) error

type OpenWhiskMessage

type OpenWhiskMessage struct {
	Value InitMessage `json:"value"`
}

type OpenWhiskOption

type OpenWhiskOption func(*OpenWhisk)

func WithAuthToken

func WithAuthToken(token string) OpenWhiskOption

func WithHost

func WithHost(host string) OpenWhiskOption

func WithVerboseLogging

func WithVerboseLogging() OpenWhiskOption

type QualifiedName

type QualifiedName struct {
	EntityName string // pkg+entity
	// contains filtered or unexported fields
}

func NewQualifiedName

func NewQualifiedName(name string) (*QualifiedName, error)

NewQualifiedName(name) initializes and constructs a (possibly fully qualified)

QualifiedName struct.

NOTE: If the given qualified name is None, then this is a default qualified
    name and it is resolved from properties.
NOTE: If the namespace is missing from the qualified name, the namespace
    is also resolved from the property file.

Examples:

foo => qualifiedName {namespace: "_", entityName: foo}
pkg/foo => qualifiedName {namespace: "_", entityName: pkg/foo}
/ns/foo => qualifiedName {namespace: ns, entityName: foo}
/ns/pkg/foo => qualifiedName {namespace: ns, entityName: pkg/foo}

func (*QualifiedName) GetEntity

func (qualifiedName *QualifiedName) GetEntity() string

GetEntity() returns the name of entity in qualifiedName without a leading '/'

func (*QualifiedName) GetEntityName

func (qualifiedName *QualifiedName) GetEntityName() string

GetEntityName() returns the entity name ([package/]entity) of qualifiedName

without a leading '/'

func (*QualifiedName) GetFullQualifiedName

func (qualifiedName *QualifiedName) GetFullQualifiedName() string

GetFullQualifiedName() returns a full qualified name in proper string format

from qualifiedName with proper syntax.

Example: /namespace/[package/]entity

func (*QualifiedName) GetNamespace

func (qualifiedName *QualifiedName) GetNamespace() string

GetNamespace() returns the name of the namespace in qualifiedName without

a leading '/'

func (*QualifiedName) GetPackageName

func (qualifiedName *QualifiedName) GetPackageName() string

GetPackageName() returns the package name from qualifiedName without a

leading '/'

type RunMessage

type RunMessage struct {
	Input         interface{} `json:"value"`
	Namespace     string      `json:"namespace"`
	Name          string      `json:"action_name"`
	Key           string      `json:"api_key"`
	ActivationID  string      `json:"activation_id"`
	TransactionID string      `json:"transaction_id"`
}

Jump to

Keyboard shortcuts

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