commands

package
v0.0.0-...-de2e593 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MEMORY_LIMIT      = 256
	TIMEOUT_LIMIT     = 60000
	LOGSIZE_LIMIT     = 10
	CONCURRENCY_LIMIT = 1
	ACTIVATION_ID     = "activationId"
	WEB_EXPORT_ANNOT  = "web-export"
	RAW_HTTP_ANNOT    = "raw-http"
	FINAL_ANNOT       = "final"
	WEB_SECURE_ANNOT  = "require-whisk-auth"
	NODE_JS_EXT       = ".js"
	PYTHON_EXT        = ".py"
	JAVA_EXT          = ".jar"
	SWIFT_EXT         = ".swift"
	ZIP_EXT           = ".zip"
	PHP_EXT           = ".php"
	BAL_BIN_EXT       = ".balx"
	RUBY_EXT          = ".rb"
	GO_EXT            = ".go"
	NODE_JS           = "nodejs"
	PYTHON            = "python"
	JAVA              = "java"
	SWIFT             = "swift"
	PHP               = "php"
	RUBY              = "ruby"
	GO                = "go"
	BAL               = "ballerina"
	DEFAULT           = "default"
	BLACKBOX          = "blackbox"
	SEQUENCE          = "sequence"
	FETCH_CODE        = true
	DO_NOT_FETCH_CODE = false
	ACTION_UPDATE     = true
	ACTION_CREATE     = false
	MAX_JS_INT        = 1<<53 - 1
)
View Source
const (
	PollInterval             = time.Second * 2
	Delay                    = time.Second * 5
	MAX_ACTIVATION_LIMIT     = 200
	DEFAULT_ACTIVATION_LIMIT = 30
)
View Source
const (
	MEMORY_FLAG      = "memory"
	LOG_SIZE_FLAG    = "logsize"
	CONCURRENCY_FLAG = "concurrency"
	TIMEOUT_FLAG     = "timeout"
	WEB_FLAG         = "web"
	WEB_SECURE_FLAG  = "web-secure"
	SAVE_FLAG        = "save"
	SAVE_AS_FLAG     = "save-as"
)
View Source
const (
	FEED_CONFIGURATION_FAILURE = "FEED_CONFIGURATION_FAILURE"
	CMD_DESC_LONG_DEPLOY       = "CMD_DESC_LONG_DEPLOY"
	CMD_DESC_LONG_SYNC         = "CMD_DESC_LONG_SYNC"
	CMD_DESC_LONG_UNDEPLOY     = "CMD_DESC_LONG_UNDEPLOY"
	CMD_DESC_LONG_EXPORT       = "CMD_DESC_LONG_EXPORT"
)

*

  • Mapping from identifiers to message ids in wski18n resources. *
  • NOTE: this list is not complete as message will be moved incrementally.
View Source
const BASH_AUTOCOMPLETE_FILENAME string = "wsk_cli_bash_completion.sh"
View Source
const DefaultAPIBuild string = ""
View Source
const DefaultAPIBuildNo string = ""
View Source
const DefaultAPIHost string = ""
View Source
const DefaultAPIVersion string = "v1"
View Source
const DefaultAuth string = ""
View Source
const DefaultCert string = ""
View Source
const DefaultKey string = ""
View Source
const DefaultNamespace string = "_"
View Source
const DefaultOpenWhiskApiPath string = "/api"
View Source
const DefaultPropsFile string = "~/.wskprops"
View Source
const FEED_AUTH_KEY = "authKey"
View Source
const FEED_CREATE = "CREATE"
View Source
const FEED_DELETE = "DELETE"
View Source
const FEED_LIFECYCLE_EVENT = "lifecycleEvent"
View Source
const FEED_READ = "READ"
View Source
const FEED_TRIGGER_NAME = "triggerName"
View Source
const FEED_UPDATE = "UPDATE"
View Source
const SDK_DOCKER_COMPONENT_NAME string = "docker"
View Source
const SDK_IOS_COMPONENT_NAME string = "ios"

Variables

View Source
var AdditionalHeaders http.Header
View Source
var ApiGwAccessToken string

When set, this overrides the default access token used to authenticate with the api gw

View Source
var Client *whisk.Client
View Source
var ContextId string

When set, this overrides the default authkey based api context id

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
}
View Source
var UserAgent string = "OpenWhisk-CLI"
View Source
var WskCmd = &cobra.Command{
	Use:               "wsk",
	Short:             wski18n.T("OpenWhisk cloud computing command line interface."),
	Long:              logoText(),
	SilenceUsage:      true,
	PersistentPreRunE: parseConfigFlags,
}

WskCmd defines the entry point for the cli.

Functions

func AssignListInfo

func AssignListInfo(actionName string, verb string, apiName string, basePath string, relPath string, url string) whisk.ApiFilteredList

AssignListInfo(actionName, verb, apiName, basePath, relPath, url) assigns

the given vaules to and initializes an ApiFilteredList struct, then returns it.

func AssignRowInfo

func AssignRowInfo(actionName string, verb string, apiName string, basePath string, relPath string, url string) whisk.ApiFilteredRow

AssignRowInfo(actionName, verb, apiName, basePath, relPath, url) assigns

the given vaules to and initializes an ApiFilteredRow struct, then returns it.

func CheckArgs

func CheckArgs(args []string, minimumArgNumber int, maximumArgNumber int, commandName string,
	requiredArgMsg string) *whisk.WskError

func CreateExtendedVersion

func CreateExtendedVersion(Client *whisk.Client, args []string) error

CreateExtendedVersion only executes when users indicate to create triggers with --feed-param or --trigger-param flags.

func Execute

func Execute() error

func ExitOnError

func ExitOnError(err error)

func FileExists

func FileExists(file string) (bool, error)

func GetPropertiesFilePath

func GetPropertiesFilePath() (propsFilePath string, werr error)

func IsDebug

func IsDebug() bool

func IsValidApiVerb

func IsValidApiVerb(verb string) (error, bool)

func IsVerbose

func IsVerbose() bool

func NewQualifiedNameError

func NewQualifiedNameError(entityName string, err error) error

NewQualifiedNameError(entityName, err) returns specific whisk error

for invalid qualified names.

func ReadFile

func ReadFile(filename string) (string, error)

func ReadProps

func ReadProps(path string) (map[string]string, error)

func SetDefaultProperties

func SetDefaultProperties()

func SetupClientConfig

func SetupClientConfig(cmd *cobra.Command, args []string) error

func Swap

func Swap(sortables Sortables, i, j int)

Uses quickSort to sort commands based on their compare methods Param: Takes in a array of Sortable interfaces which contains a specific command

func UpdateExtendedVersion

func UpdateExtendedVersion(Client *whisk.Client, args []string, retTrigger *whisk.Trigger) error

UpdateExtendedVersion only executes when users indicate to update triggers with --feed-param or --trigger-param flags.

func WriteProps

func WriteProps(path string, props map[string]string) error

Types

type ActionFlags

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

type FlagsStruct

type FlagsStruct struct {
	Global struct {
		Verbose    bool
		Debug      bool
		Cert       string
		Key        string
		Auth       string
		Apihost    string
		Apiversion string
		Insecure   bool
	}
	// contains filtered or unexported fields
}
var Flags FlagsStruct

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 Sortables

type Sortables []whisk.Sortable

type Trigger

type Trigger struct {
}

func (*Trigger) Create

func (t *Trigger) Create(Client *whisk.Client, args []string) error

func (*Trigger) Update

func (t *Trigger) Update(Client *whisk.Client, args []string) error

type WebActionAnnotationMethod

type WebActionAnnotationMethod func(annotations whisk.KeyValueArr) whisk.KeyValueArr

Jump to

Keyboard shortcuts

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