Documentation
¶
Index ¶
- Constants
- func GetQualifiedName(functioname string) (string, string)
- type BatchRequest
- type ConcurrentRateLimiter
- type Limiter
- type OWInfoResponse
- type WhiskCacheConfigInjector
- type WhiskClient
- func (l *WhiskClient) Close() error
- func (l *WhiskClient) DeleteFunction(name string) error
- func (l *WhiskClient) DeployFunction(conf WhiskFunctionConfig) error
- func (l *WhiskClient) Invoke(name string, payload interface{}) (io.ReadCloser, error)
- func (l *WhiskClient) InvokeAsBatch(name string, payloads []interface{}) ([]interface{}, error)
- func (l *WhiskClient) InvokeAsync(name string, payload interface{}) (interface{}, error)
- func (l *WhiskClient) ReceiveUntil(when func() bool) chan io.ReadCloser
- type WhiskClientApi
- type WhiskClientConfig
- type WhiskFunctionConfig
- type WhiskPayload
Constants ¶
View Source
const MaxPullRetries = 4
View Source
const MaxRetries = 3
MaxLambdaRetries is the number of times to try invoking a function before giving up and returning an error
Variables ¶
This section is empty.
Functions ¶
func GetQualifiedName ¶
returns name and namespace based on function name
Types ¶
type BatchRequest ¶
type BatchRequest struct {
Payloads []WhiskPayload `json:"payloads"`
}
type ConcurrentRateLimiter ¶
type ConcurrentRateLimiter struct {
TokenPerMinute int64
ConcurrentToken int
// contains filtered or unexported fields
}
func NewConcurrentRateLimiter ¶
func NewConcurrentRateLimiter(tokenPerMinute int64, concurrentToken int) (*ConcurrentRateLimiter, error)
func (*ConcurrentRateLimiter) Allow ¶
func (c *ConcurrentRateLimiter) Allow()
type OWInfoResponse ¶
type OWInfoResponse struct {
Features struct {
BatchRequestFeature bool `json:"batch"`
CallbackFeature bool `json:"feedback"`
LCHFeature bool `json:"lch"`
} `json:"features,omitempty"`
Limits struct {
ActionsPerMinute int64 `json:"actions_per_minute"`
ConcurrentActions int `json:"concurrent_actions"`
MaxActionDuration int64 `json:"max_action_duration"`
MaxActionMemory int64 `json:"max_action_memory"`
MinActionDuration int64 `json:"min_action_duration"`
MinActionMemory int64 `json:"min_action_memory"`
} `json:"limits,omitempty"`
}
type WhiskCacheConfigInjector ¶
type WhiskCacheConfigInjector interface {
api.CacheConfigInjector
ConfigureWhisk(action *whisk.Action) error
}
type WhiskClient ¶
type WhiskClient struct {
Client *whisk.Client
ConcurrencyLimit *int
// contains filtered or unexported fields
}
func (*WhiskClient) Close ¶
func (l *WhiskClient) Close() error
func (*WhiskClient) DeleteFunction ¶
func (l *WhiskClient) DeleteFunction(name string) error
func (*WhiskClient) DeployFunction ¶
func (l *WhiskClient) DeployFunction(conf WhiskFunctionConfig) error
func (*WhiskClient) Invoke ¶
func (l *WhiskClient) Invoke(name string, payload interface{}) (io.ReadCloser, error)
func (*WhiskClient) InvokeAsBatch ¶
func (l *WhiskClient) InvokeAsBatch(name string, payloads []interface{}) ([]interface{}, error)
func (*WhiskClient) InvokeAsync ¶
func (l *WhiskClient) InvokeAsync(name string, payload interface{}) (interface{}, error)
func (*WhiskClient) ReceiveUntil ¶
func (l *WhiskClient) ReceiveUntil(when func() bool) chan io.ReadCloser
ReciveUnitl will copy all io.ReadCloser received until the when function is true or until the client context is closed. In these cases the channal will be closed to singal the end to the consumer.
type WhiskClientApi ¶
type WhiskClientApi interface {
Invoke(name string, payload interface{}) (io.ReadCloser, error)
InvokeAsBatch(name string, payload []interface{}) ([]interface{}, error)
InvokeAsync(name string, payload interface{}) (interface{}, error)
ReceiveUntil(when func() bool) chan io.ReadCloser
DeployFunction(conf WhiskFunctionConfig) error
DeleteFunction(name string) error
}
func NewWhiskClient ¶
func NewWhiskClient(conf WhiskClientConfig) WhiskClientApi
NewWhiskClient initializes a new openwhisk client
type WhiskClientConfig ¶
type WhiskFunctionConfig ¶
type WhiskFunctionConfig struct {
Memory int
Timeout int
FunctionName string
CacheConfigInjector api.CacheConfigInjector
}
type WhiskPayload ¶
Click to show internal directories.
Click to hide internal directories.