Documentation
¶
Index ¶
- Constants
- Variables
- func BodyTruncator(body io.ReadCloser) (string, io.ReadCloser, error)
- func Debug(dl DebugLevel, msgFormat string, args ...interface{})
- func GetURLBase(host string, path string) (*url.URL, error)
- func IsDebug() bool
- func IsHttpRespSuccess(r *http.Response) bool
- func IsResponseResultSuccess(data []byte) bool
- func IsVerbose() bool
- func ObfuscateText(text string, replacements []ObfuscateSet) string
- func PrintJSON(v interface{})
- func PrintRequestInfo(req *http.Request, secretToObfuscate ...ObfuscateSet) (*http.Request, error)
- func PrintResponseInfo(resp *http.Response, secretToObfuscate ...ObfuscateSet) (*http.Response, []byte, error)
- func SetDebug(b bool)
- func SetVerbose(b bool)
- func Verbose(msgFormat string, args ...interface{})
- type Action
- func (action Action) ActionURL(apiHost string, apiPath string, apiVersion string, pkg string) (string, error)
- func (action Action) Compare(sortable Sortable) bool
- func (action Action) ToHeaderString() string
- func (action Action) ToSummaryRowString() string
- func (action Action) WebAction() (webExportValue bool)
- type ActionListOptions
- type ActionService
- func (s *ActionService) Delete(actionName string) (*http.Response, error)
- func (s *ActionService) Get(actionName string) (*Action, *http.Response, error)
- func (s *ActionService) Insert(action *Action, overwrite bool) (*Action, *http.Response, error)
- func (s *ActionService) Invoke(actionName string, payload interface{}, blocking bool, result bool) (map[string]interface{}, *http.Response, error)
- func (s *ActionService) List(packageName string, options *ActionListOptions) ([]Action, *http.Response, error)
- type Activation
- type ActivationListOptions
- type ActivationService
- func (s *ActivationService) Get(activationID string) (*Activation, *http.Response, error)
- func (s *ActivationService) List(options *ActivationListOptions) ([]Activation, *http.Response, error)
- func (s *ActivationService) Logs(activationID string) (*Activation, *http.Response, error)
- func (s *ActivationService) Result(activationID string) (*Response, *http.Response, error)
- type Annotations
- type Api
- type ApiAction
- type ApiCreateRequest
- type ApiCreateRequestOptions
- type ApiCreateResponse
- type ApiDeleteRequest
- type ApiDeleteRequestOptions
- type ApiDeleteResponse
- type ApiFilteredList
- type ApiFilteredRow
- type ApiGetRequest
- type ApiGetRequestOptions
- type ApiGetResponse
- type ApiItem
- type ApiListRequest
- type ApiListRequestOptions
- type ApiListResponse
- type ApiOptions
- type ApiService
- func (s *ApiService) Delete(api *ApiDeleteRequest, options *ApiDeleteRequestOptions) (*http.Response, error)
- func (s *ApiService) Get(api *ApiGetRequest, options *ApiGetRequestOptions) (*ApiGetResponse, *http.Response, error)
- func (s *ApiService) Insert(api *ApiCreateRequest, options *ApiCreateRequestOptions, overwrite bool) (*ApiCreateResponse, *http.Response, error)
- func (s *ApiService) List(apiListOptions *ApiListRequestOptions) (*ApiListResponse, *http.Response, error)
- type ApiSwagger
- type ApiSwaggerInfo
- type ApiSwaggerOpXOpenWhisk
- type ApiSwaggerOperation
- type ApiUserAuth
- type AppErrorResult
- type Binding
- type BindingPackage
- type BindingUpdates
- type Client
- func (c *Client) Do(req *http.Request, v interface{}, ExitWithErrorOnTimeout bool, ...) (*http.Response, error)
- func (c *Client) NewRequest(method, urlStr string, body interface{}, includeNamespaceInUrl bool) (*http.Request, error)
- func (c *Client) NewRequestUrl(method string, urlRelResource *url.URL, body interface{}, ...) (*http.Request, error)
- type Config
- type Contents
- type DebugLevel
- type ErrorResponse
- type Exec
- type Info
- type InfoService
- type KeyValue
- type KeyValueArr
- type Limits
- type Log
- type Namespace
- type NamespaceService
- type ObfuscateSet
- type Package
- type PackageInterface
- type PackageListOptions
- type PackageService
- func (s *PackageService) Delete(packageName string) (*http.Response, error)
- func (s *PackageService) Get(packageName string) (*Package, *http.Response, error)
- func (s *PackageService) Insert(x_package PackageInterface, overwrite bool) (*Package, *http.Response, error)
- func (s *PackageService) List(options *PackageListOptions) ([]Package, *http.Response, error)
- func (s *PackageService) Refresh() (*BindingUpdates, *http.Response, error)
- type Parameters
- type Printable
- type Response
- type Result
- type RetApi
- type RetApiArray
- type Rule
- type RuleListOptions
- type RuleService
- func (s *RuleService) Delete(ruleName string) (*http.Response, error)
- func (s *RuleService) Get(ruleName string) (*Rule, *http.Response, error)
- func (s *RuleService) Insert(rule *Rule, overwrite bool) (*Rule, *http.Response, error)
- func (s *RuleService) List(options *RuleListOptions) ([]Rule, *http.Response, error)
- func (s *RuleService) SetState(ruleName string, state string) (*Rule, *http.Response, error)
- type Sdk
- type SdkRequest
- type SdkService
- type Sortable
- type Trigger
- type TriggerListOptions
- type TriggerService
- func (s *TriggerService) Delete(triggerName string) (*Trigger, *http.Response, error)
- func (s *TriggerService) Fire(triggerName string, payload interface{}) (*Trigger, *http.Response, error)
- func (s *TriggerService) Get(triggerName string) (*Trigger, *http.Response, error)
- func (s *TriggerService) Insert(trigger *Trigger, overwrite bool) (*Trigger, *http.Response, error)
- func (s *TriggerService) List(options *TriggerListOptions) ([]Trigger, *http.Response, error)
- type WhiskError
- type WhiskErrorResponse
- type WhiskResponse
- type WhiskResult
- type WskError
Constants ¶
const ( Overwrite = true DoNotOverwrite = false )
const ( AuthRequired = true NoAuth = false IncludeNamespaceInUrl = true DoNotIncludeNamespaceInUrl = false AppendOpenWhiskPathPrefix = true DoNotAppendOpenWhiskPathPrefix = false EncodeBodyAsJson = "json" EncodeBodyAsFormData = "formdata" ProcessTimeOut = true DoNotProcessTimeOut = false ExitWithErrorOnTimeout = true ExitWithSuccessOnTimeout = false )
const APPLICATION_ERR bool = true
const DISPLAY_MSG bool = true
const DISPLAY_PREFIX bool = true
const DISPLAY_USAGE bool = true
const EXIT_CODE_ERR_GENERAL int = 1
const EXIT_CODE_ERR_HTTP_RESP int = 4
const EXIT_CODE_ERR_NETWORK int = 3
const EXIT_CODE_ERR_USAGE int = 2
const EXIT_CODE_NOT_FOUND int = 148
const EXIT_CODE_TIMED_OUT int = 202
const MaxNameLen int = 25
const NOT_ALLOWED int = 149
const NO_APPLICATION_ERR bool = false
const NO_DISPLAY_MSG bool = false
const NO_DISPLAY_PREFIX bool = false
const NO_DISPLAY_USAGE bool = false
const NO_MSG_DISPLAYED bool = false
const TIMED_OUT bool = true
Variables ¶
var ApiVerbs map[string]bool = map[string]bool{ "GET": true, "PUT": true, "POST": true, "DELETE": true, "PATCH": true, "HEAD": true, "OPTIONS": true, }
var DefaultObfuscateArr = []ObfuscateSet{
{
Regex: "\"[Pp]assword\":\\s*\".*\"",
Replacement: `"password": "******"`,
},
}
Functions ¶
func BodyTruncator ¶
func BodyTruncator(body io.ReadCloser) (string, io.ReadCloser, error)
bodyTruncator limits the size of Req/Resp Body for --verbose ONLY. It returns truncated Req/Resp Body, reloaded io.ReadCloser and any errors.
func Debug ¶
func Debug(dl DebugLevel, msgFormat string, args ...interface{})
Function for tracing debug level messages to stdout
Output format: [file-or-function-name]:line-#:[DebugLevel] The formated message without any appended \n
func IsHttpRespSuccess ¶
func IsResponseResultSuccess ¶
func ObfuscateText ¶
func ObfuscateText(text string, replacements []ObfuscateSet) string
func PrintRequestInfo ¶
func PrintResponseInfo ¶
func SetVerbose ¶
func SetVerbose(b bool)
Types ¶
type Action ¶
type Action struct {
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Exec *Exec `json:"exec,omitempty"`
Annotations KeyValueArr `json:"annotations,omitempty"`
Parameters KeyValueArr `json:"parameters,omitempty"`
Limits *Limits `json:"limits,omitempty"`
Error string `json:"error,omitempty"`
Code int `json:"code,omitempty"`
Publish *bool `json:"publish,omitempty"`
}
func (Action) ActionURL ¶
func (action Action) ActionURL(apiHost string, apiPath string, apiVersion string, pkg string) (string, error)
Returns the URL of an action as a string. A valid API host, path and version must be passed. A package that contains the action must be passed as well. An empty string must be passed if the action is not packaged.
func (Action) Compare ¶
Compare(sortable) compares action to sortable for the purpose of sorting. REQUIRED: sortable must also be of type Action. ***Method of type Sortable***
func (Action) ToHeaderString ¶
ToHeaderString() returns the header for a list of actions
func (Action) ToSummaryRowString ¶
ToSummaryRowString() returns a compound string of required parameters for printing
from CLI command `wsk action list`.
***Method of type Sortable***
type ActionListOptions ¶
type ActionService ¶
type ActionService struct {
// contains filtered or unexported fields
}
func (*ActionService) Delete ¶
func (s *ActionService) Delete(actionName string) (*http.Response, error)
func (*ActionService) List ¶
func (s *ActionService) List(packageName string, options *ActionListOptions) ([]Action, *http.Response, error)
type Activation ¶
type Activation struct {
Namespace string `json:"namespace"`
Name string `json:"name"`
Version string `json:"version"`
Subject string `json:"subject"`
ActivationID string `json:"activationId"`
Cause string `json:"cause,omitempty"`
Start int64 `json:"start"` // When action started (in milliseconds since January 1, 1970 UTC)
End int64 `json:"end"` // Since a 0 is a valid value from server, don't omit
Duration int64 `json:"duration"` // Only available for actions
Response `json:"response"`
Logs []string `json:"logs"`
Annotations KeyValueArr `json:"annotations"`
Publish *bool `json:"publish,omitempty"`
}
func (Activation) Compare ¶
func (activation Activation) Compare(sortable Sortable) bool
Compare(sortable) compares activation to sortable for the purpose of sorting. REQUIRED: sortable must also be of type Activation. ***Method of type Sortable*** ***Currently, no method of sorting defined***
func (Activation) ToHeaderString ¶
func (activation Activation) ToHeaderString() string
ToHeaderString() returns the header for a list of activations
func (Activation) ToSummaryRowString ¶
func (activation Activation) ToSummaryRowString() string
ToSummaryRowString() returns a compound string of required parameters for printing
from CLI command `wsk activation list`.
***Method of type Sortable***
type ActivationListOptions ¶
type ActivationService ¶
type ActivationService struct {
// contains filtered or unexported fields
}
func (*ActivationService) Get ¶
func (s *ActivationService) Get(activationID string) (*Activation, *http.Response, error)
func (*ActivationService) List ¶
func (s *ActivationService) List(options *ActivationListOptions) ([]Activation, *http.Response, error)
func (*ActivationService) Logs ¶
func (s *ActivationService) Logs(activationID string) (*Activation, *http.Response, error)
type Annotations ¶
type Annotations []map[string]interface{}
type Api ¶
type Api struct {
Namespace string `json:"namespace,omitempty"`
ApiName string `json:"apiName,omitempty"`
GatewayBasePath string `json:"gatewayBasePath,omitempty"`
GatewayRelPath string `json:"gatewayPath,omitempty"`
GatewayMethod string `json:"gatewayMethod,omitempty"`
Id string `json:"id,omitempty"`
GatewayFullPath string `json:"gatewayFullPath,omitempty"`
Swagger string `json:"swagger,omitempty"`
Action *ApiAction `json:"action,omitempty"`
}
type ApiCreateRequest ¶
type ApiCreateRequest struct {
ApiDoc *Api `json:"apidoc,omitempty"`
}
wsk api create : Request, Response
type ApiCreateRequestOptions ¶
type ApiCreateRequestOptions ApiOptions
type ApiCreateResponse ¶
type ApiCreateResponse RetApi
type ApiDeleteRequestOptions ¶
type ApiDeleteRequestOptions ApiOptions
type ApiDeleteResponse ¶
type ApiDeleteResponse struct{}
type ApiFilteredList ¶
type ApiFilteredList struct {
ActionName string
ApiName string
BasePath string
RelPath string
Verb string
Url string
}
Used for printing individual APIs in non-truncated form
func (ApiFilteredList) Compare ¶
func (api ApiFilteredList) Compare(sortable Sortable) bool
Compare(sortable) compares api to sortable for the purpose of sorting. REQUIRED: sortable must also be of type ApiFilteredList. ***Method of type Sortable***
func (ApiFilteredList) ToHeaderString ¶
func (api ApiFilteredList) ToHeaderString() string
ToHeaderString() returns the header for a list of apis
func (ApiFilteredList) ToSummaryRowString ¶
func (api ApiFilteredList) ToSummaryRowString() string
ToSummaryRowString() returns a compound string of required parameters for printing
from CLI command `wsk api list` or `wsk api-experimental list`.
***Method of type Sortable***
type ApiFilteredRow ¶
type ApiFilteredRow struct {
ActionName string
ApiName string
BasePath string
RelPath string
Verb string
Url string
FmtString string
}
Used for printing individual APIs in truncated form
func (ApiFilteredRow) Compare ¶
func (api ApiFilteredRow) Compare(sortable Sortable) bool
Compare(sortable) compares api to sortable for the purpose of sorting. REQUIRED: sortable must also be of type ApiFilteredRow. ***Method of type Sortable***
func (ApiFilteredRow) ToHeaderString ¶
func (api ApiFilteredRow) ToHeaderString() string
ToHeaderString() returns the header for a list of apis
func (ApiFilteredRow) ToSummaryRowString ¶
func (api ApiFilteredRow) ToSummaryRowString() string
ToSummaryRowString() returns a compound string of required parameters for printing
from CLI command `wsk api list -f` or `wsk api-experimental list -f`.
***Method of type Sortable***
type ApiGetRequestOptions ¶
type ApiGetRequestOptions ApiOptions
type ApiGetResponse ¶
type ApiGetResponse RetApiArray
type ApiListRequestOptions ¶
type ApiListRequestOptions struct {
ApiOptions
Limit int `url:"limit"`
Skip int `url:"skip"`
Docs bool `url:"docs,omitempty"`
}
type ApiListResponse ¶
type ApiListResponse RetApiArray
type ApiOptions ¶
type ApiOptions struct {
ActionName string `url:"action,omitempty"`
ApiBasePath string `url:"basepath,omitempty"`
ApiRelPath string `url:"relpath,omitempty"`
ApiVerb string `url:"operation,omitempty"`
ApiName string `url:"apiname,omitempty"`
SpaceGuid string `url:"spaceguid,omitempty"`
AccessToken string `url:"accesstoken,omitempty"`
ResponseType string `url:"responsetype,omitempty"`
}
type ApiService ¶
type ApiService struct {
// contains filtered or unexported fields
}
func (*ApiService) Delete ¶
func (s *ApiService) Delete(api *ApiDeleteRequest, options *ApiDeleteRequestOptions) (*http.Response, error)
func (*ApiService) Get ¶
func (s *ApiService) Get(api *ApiGetRequest, options *ApiGetRequestOptions) (*ApiGetResponse, *http.Response, error)
func (*ApiService) Insert ¶
func (s *ApiService) Insert(api *ApiCreateRequest, options *ApiCreateRequestOptions, overwrite bool) (*ApiCreateResponse, *http.Response, error)
func (*ApiService) List ¶
func (s *ApiService) List(apiListOptions *ApiListRequestOptions) (*ApiListResponse, *http.Response, error)
type ApiSwagger ¶
type ApiSwagger struct {
SwaggerName string `json:"swagger,omitempty"`
BasePath string `json:"basePath,omitempty"`
Info *ApiSwaggerInfo `json:"info,omitempty"`
Paths map[string]map[string]*ApiSwaggerOperation `json:"paths,omitempty"` // Paths["/a/path"]["get"] -> a generic object
SecurityDef interface{} `json:"securityDefinitions,omitempty"`
Security interface{} `json:"security,omitempty"`
XConfig interface{} `json:"x-ibm-configuration,omitempty"`
XRateLimit interface{} `json:"x-ibm-rate-limit,omitempty"`
}
type ApiSwaggerInfo ¶
type ApiSwaggerOpXOpenWhisk ¶
type ApiSwaggerOperation ¶
type ApiSwaggerOperation struct {
OperationId string `json:"operationId"`
Responses interface{} `json:"responses"`
XOpenWhisk *ApiSwaggerOpXOpenWhisk `json:"x-openwhisk,omitempty"`
}
type ApiUserAuth ¶
type AppErrorResult ¶
type AppErrorResult struct {
Error *interface{} `json:"error"`
}
type BindingPackage ¶
type BindingPackage struct {
Namespace string `json:"-"`
Name string `json:"-"`
Version string `json:"version,omitempty"`
Publish *bool `json:"publish,omitempty"`
Annotations KeyValueArr `json:"annotations,omitempty"`
Parameters KeyValueArr `json:"parameters,omitempty"`
Binding `json:"binding"`
}
Use this struct when creating a binding Publish is NOT optional; Binding is a namespace/name object, not a bool
func (*BindingPackage) GetName ¶
func (p *BindingPackage) GetName() string
type BindingUpdates ¶
type Client ¶
type Client struct {
*Config
Transport *http.Transport
Sdks *SdkService
Triggers *TriggerService
Actions *ActionService
Rules *RuleService
Activations *ActivationService
Packages *PackageService
Namespaces *NamespaceService
Info *InfoService
Apis *ApiService
// contains filtered or unexported fields
}
func (*Client) Do ¶
func (c *Client) Do(req *http.Request, v interface{}, ExitWithErrorOnTimeout bool, secretToObfuscate ...ObfuscateSet) (*http.Response, error)
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) NewRequest ¶
func (*Client) NewRequestUrl ¶
func (c *Client) NewRequestUrl( method string, urlRelResource *url.URL, body interface{}, includeNamespaceInUrl bool, appendOpenWhiskPath bool, encodeBodyAs string, useAuthentication bool) (*http.Request, error)
Create a HTTP request object using URL stored in url.URL object Arguments:
method - HTTP verb (i.e. "GET", "PUT", etc) urlRelResource - *url.URL structure representing the relative resource URL, including query params body - optional. Object whose contents will be JSON encoded and placed in HTTP request body includeNamespaceInUrl - when true "/namespaces/NAMESPACE" is included in the final URL; otherwise not included. appendOpenWhiskPath - when true, the OpenWhisk URL format is generated encodeBodyAs - specifies body encoding (json or form data) useAuthentication - when true, the basic Authorization is included with the configured authkey as the value
type DebugLevel ¶
type DebugLevel string
const ( DbgInfo DebugLevel = "Inf" DbgWarn DebugLevel = "Wrn" DbgError DebugLevel = "Err" DbgFatal DebugLevel = "Ftl" )
type ErrorResponse ¶
type ErrorResponse struct {
Response *http.Response // HTTP response that caused this error
ErrMsg *interface{} `json:"error"` // error message string
Code *int64 `json:"code"` // validation error code
}
For containing the server response body when an error message is returned Here's an example error response body with HTTP status code == 400
{
"error": "namespace contains invalid characters",
"code": 1422870
}
func (ErrorResponse) Error ¶
func (r ErrorResponse) Error() string
type InfoService ¶
type InfoService struct {
// contains filtered or unexported fields
}
type KeyValueArr ¶
type KeyValueArr []KeyValue
func (KeyValueArr) AppendKeyValueArr ¶
func (keyValueArr KeyValueArr) AppendKeyValueArr(appKeyValueArr KeyValueArr) KeyValueArr
Appends items from appKeyValueArr to keyValueArr if the appKeyValueArr item does not exist in keyValueArr.
func (KeyValueArr) FindKeyValue ¶
func (keyValueArr KeyValueArr) FindKeyValue(key string) int
func (KeyValueArr) GetValue ¶
func (keyValueArr KeyValueArr) GetValue(key string) (res interface{})
Retrieves a value associated with a given key from a KeyValueArr. A key of type string must be passed to the method. An interface will be returned containing the found value. If a key could not be found, a nil value will be returned.
type Log ¶
type Log struct {
Log string `json:"log,omitempty"`
Stream string `json:"stream,omitempty"`
Time string `json:"time,omitempty"`
}
MWD - This structure may no longer be needed as the log format is now a string and not JSON
type Namespace ¶
func (Namespace) Compare ¶
Compare(sortable) compares namespace to sortable for the purpose of sorting. REQUIRED: sortable must also be of type Namespace. ***Method of type Sortable***
func (Namespace) ToHeaderString ¶
ToHeaderString() returns the header for a list of namespaces
func (Namespace) ToSummaryRowString ¶
ToSummaryRowString() returns a compound string of required parameters for printing
from CLI command `wsk namespace list`.
***Method of type Sortable***
type NamespaceService ¶
type NamespaceService struct {
// contains filtered or unexported fields
}
type ObfuscateSet ¶
type Package ¶
type Package struct {
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Publish *bool `json:"publish,omitempty"`
Annotations KeyValueArr `json:"annotations,omitempty"`
Parameters KeyValueArr `json:"parameters,omitempty"`
Binding *Binding `json:"binding,omitempty"`
Actions []Action `json:"actions,omitempty"`
Feeds []Action `json:"feeds,omitempty"`
}
Use this struct to represent the package/binding sent from the Whisk server Binding is a bool ???MWD20160602 now seeing Binding as a struct???
func (Package) Compare ¶
Compare(sortable) compares xPackage to sortable for the purpose of sorting. REQUIRED: sortable must also be of type Package. ***Method of type Sortable***
func (Package) ToHeaderString ¶
ToHeaderString() returns the header for a list of actions
func (Package) ToSummaryRowString ¶
ToSummaryRowString() returns a compound string of required parameters for printing
from CLI command `wsk package list`.
***Method of type Sortable***
type PackageInterface ¶
type PackageInterface interface {
GetName() string
}
type PackageListOptions ¶
type PackageService ¶
type PackageService struct {
// contains filtered or unexported fields
}
func (*PackageService) Delete ¶
func (s *PackageService) Delete(packageName string) (*http.Response, error)
func (*PackageService) Insert ¶
func (s *PackageService) Insert(x_package PackageInterface, overwrite bool) (*Package, *http.Response, error)
func (*PackageService) List ¶
func (s *PackageService) List(options *PackageListOptions) ([]Package, *http.Response, error)
func (*PackageService) Refresh ¶
func (s *PackageService) Refresh() (*BindingUpdates, *http.Response, error)
type Parameters ¶
type Parameters *json.RawMessage
type Printable ¶
type Printable interface {
ToHeaderString() string // Prints header information of a Printable
ToSummaryRowString() string // Prints summary info of one Printable
}
Printable items are anything that need to be printed for listing purposes.
type RetApi ¶
type RetApi struct {
Namespace string `json:"namespace"`
BaseUrl string `json:"gwApiUrl"`
Activated bool `json:"gwApiActivated"`
TenantId string `json:"tenantId"`
Swagger *ApiSwagger `json:"apidoc,omitempty"`
}
type RetApiArray ¶
type RetApiArray struct {
Apis []ApiItem `json:"apis,omitempty"`
}
type Rule ¶
type Rule struct {
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Status string `json:"status"`
Trigger interface{} `json:"trigger"`
Action interface{} `json:"action"`
Publish *bool `json:"publish,omitempty"`
}
func (Rule) Compare ¶
Compare(sortable) compares rule to sortable for the purpose of sorting. REQUIRED: sortable must also be of type Rule. ***Method of type Sortable***
func (Rule) ToHeaderString ¶
ToHeaderString() returns the header for a list of rules
func (Rule) ToSummaryRowString ¶
ToSummaryRowString() returns a compound string of required parameters for printing
from CLI command `wsk rule list`.
***Method of type Sortable***
type RuleListOptions ¶
type RuleService ¶
type RuleService struct {
// contains filtered or unexported fields
}
func (*RuleService) List ¶
func (s *RuleService) List(options *RuleListOptions) ([]Rule, *http.Response, error)
type SdkRequest ¶
type SdkRequest struct {
}
type SdkService ¶
type SdkService struct {
// contains filtered or unexported fields
}
type Sortable ¶
type Sortable interface {
// Compare(sortable) compares an two sortables and returns true
// if the item calling the Compare method is less than toBeCompared.
// Sorts alphabetically by default, can have other parameters to sort by
// passed by sortByName.
Compare(toBeCompared Sortable) bool
}
Sortable items are anything that needs to be sorted for listing purposes.
type Trigger ¶
type Trigger struct {
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omityempty"`
Version string `json:"version,omitempty"`
ActivationId string `json:"activationId,omitempty"`
Annotations KeyValueArr `json:"annotations,omitempty"`
Parameters KeyValueArr `json:"parameters,omitempty"`
Limits *Limits `json:"limits,omitempty"`
Publish *bool `json:"publish,omitempty"`
}
func (Trigger) Compare ¶
Compare(sortable) compares trigger to sortable for the purpose of sorting. REQUIRED: sortable must also be of type Trigger. ***Method of type Sortable***
func (Trigger) ToHeaderString ¶
ToHeaderString() returns the header for a list of triggers
func (Trigger) ToSummaryRowString ¶
ToSummaryRowString() returns a compound string of required parameters for printing
from CLI command `wsk trigger list`.
***Method of type Sortable***
type TriggerListOptions ¶
type TriggerService ¶
type TriggerService struct {
// contains filtered or unexported fields
}
func (*TriggerService) List ¶
func (s *TriggerService) List(options *TriggerListOptions) ([]Trigger, *http.Response, error)
type WhiskError ¶
type WhiskError struct {
Msg *string `json:"msg"`
}
type WhiskErrorResponse ¶
type WhiskErrorResponse struct {
Response *WhiskResponse `json:"response"`
}
type WhiskResponse ¶
type WhiskResponse struct {
Result *WhiskResult `json:"result"`
Success bool `json:"success"`
Status *interface{} `json:"status"`
}
type WhiskResult ¶
type WhiskResult struct {
}
type WskError ¶
type WskError struct {
RootErr error // Parent error
ExitCode int // Error code to be returned to the OS
DisplayMsg bool // When true, the error message should be displayed to console
MsgDisplayed bool // When true, the error message has already been displayed, don't display it again
DisplayUsage bool // When true, the CLI usage should be displayed before exiting
DisplayPrefix bool // When true, the CLI will prefix an error message with "error: "
ApplicationError bool // When true, the error is a result of an application failure
TimedOut bool // When True, the error is a result of a timeout
}
func MakeWskError ¶
Instantiate a WskError structure Parameters:
error - RootErr. object implementing the error interface int - ExitCode. Used if error object does not have an exit code OR if ExitCodeOverride is true bool - DisplayMsg. If true, the error message should be displayed on the console bool - DisplayUsage. If true, the command usage syntax/help should be displayed on the console bool - MsgDisplayed. If true, the error message has been displayed on the console bool - DisplayPreview. If true, the error message will be prefixed with "error: " bool - TimedOut. If true, the error is a result of a timeout
func MakeWskErrorFromWskError ¶
func MakeWskErrorFromWskError(baseError error, whiskError error, exitCode int, flags ...bool) (resWhiskError *WskError)
Instantiate a WskError structure Parameters:
error - RootErr. object implementing the error interface WskError - WskError being wrappered. It's exitcode will be used as this WskError's exitcode. Ignored if nil int - ExitCode. Used if error object is nil or if the error object is not a WskError bool - DisplayMsg. If true, the error message should be displayed on the console bool - DisplayUsage. If true, the command usage syntax/help should be displayed on the console bool - MsgDisplayed. If true, the error message has been displayed on the console bool - ApplicationError. If true, the error is a result of an application error bool - TimedOut. If true, the error resulted from a timeout