common

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const Finalizer = "finalizer.openwhisk.ibm.com"

Finalizer for openwhisk resources

Variables

This section is empty.

Functions

func AddKeyValue

func AddKeyValue(key string, value interface{}, keyValueArr whisk.KeyValueArr) whisk.KeyValueArr

AddKeyValue adds a key-value pair to the given array

func ConvertKeyValues

func ConvertKeyValues(ctx context.Context, obj runtime.Object, params []kv.KeyValue, what string) (whisk.KeyValueArr, bool, error)

ConvertKeyValues convert key value array to whisk key values

func ConvertParametersFrom added in v0.7.1

func ConvertParametersFrom(ctx context.Context, obj runtime.Object, params []openwhiskv1beta1.ParametersFromSource) (whisk.KeyValueArr, bool, error)

ConvertParametersFrom converts parameters sources to whisk key value pairs

func GetValueString

func GetValueString(keyValueArr whisk.KeyValueArr, key string) (string, error)

GetValueString gets the string value for the key

func JoinQualifiedName

func JoinQualifiedName(qname QualifiedName) string

JoinQualifiedName returns a fully qualified entity name

func NewWskClient

func NewWskClient(ctx context.Context, owctx *v1.SecretEnvSource) (*whisk.Client, error)

NewWskClient creates a new whisk.Client

func ResolveFunctionName

func ResolveFunctionName(objname string, pkg *string, name *string) string

ResolveFunctionName returns the full name of a function

func SetStatusToPending

func SetStatusToPending(context context.Context, client client.Client, obj runtime.Object, format string, args ...interface{}) error

SetStatusToPending sets the status to Pending

func ShouldRetry

func ShouldRetry(resp *http.Response, err error) bool

ShouldRetry returns true when the error is recoverable

func ShouldRetryFinalize

func ShouldRetryFinalize(err error) bool

ShouldRetryFinalize returns true when the error is recoverable

func ToKeyValueArr

func ToKeyValueArr(ctx context.Context, vars []kv.KeyValue) (whisk.KeyValueArr, error)

ToKeyValueArr converts a list of key-value pairs to Whisk format

func ToKeyValueArrFromMap

func ToKeyValueArrFromMap(m interface{}) (whisk.KeyValueArr, error)

ToKeyValueArrFromMap converts raw JSON to whisk param format

func WebAction

func WebAction(webMode string, annotations whisk.KeyValueArr, fetch bool) (whisk.KeyValueArr, error)

WebAction adds web annotations

Types

type CompositionClient

type CompositionClient struct {
	APIKey string
}

CompositionClient represents a client to the composition service

func NewCompositionClient

func NewCompositionClient(ctx context.Context, owctx *v1.SecretEnvSource) (*CompositionClient, error)

NewCompositionClient creates a new composition service client

func (CompositionClient) Delete

func (client CompositionClient) Delete(name string) (map[string]interface{}, *http.Response, error)

Delete deletes a composition

func (CompositionClient) Get

func (client CompositionClient) Get(name string) (map[string]interface{}, *http.Response, error)

Get returns a composition

func (CompositionClient) Invoke

func (client CompositionClient) Invoke(name string, params interface{}) (map[string]interface{}, *http.Response, error)

Invoke invokes a composition

func (CompositionClient) Update

func (client CompositionClient) Update(name string, composition string, contentType string) (map[string]interface{}, *http.Response, error)

Update updates a composition

type QualifiedName

type QualifiedName struct {
	Namespace  string
	EntityName string
}

QualifiedName is a namespace-qualified name

func ParseQualifiedName

func ParseQualifiedName(name string, defaultNamespace string) (QualifiedName, error)

ParseQualifiedName returns a qualified name

type WskConfig

type WskConfig struct {
	WskCliAuthKey   string   `json:"WskCliAuthKey"`
	WskCliNamespace string   `json:"WskCliNamespace"`
	WskCliAPIHost   string   `json:"WskCliApiHost"`
	WskCliInsecure  bool     `json:"WskCliInsecure"`
	WskCliCert      string   `json:"WskCliCert"`
	WskCliBaseURL   *url.URL `json:"WskBaseURL"`
}

WskConfig struct

func GetWskPropertiesFromSecret

func GetWskPropertiesFromSecret(ctx context.Context, secretName string) (*WskConfig, error)

GetWskPropertiesFromSecret returns WskConfig from secret

Jump to

Keyboard shortcuts

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