Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSLambdaCustomRuntime ¶
type AWSLambdaCustomRuntime struct {
// contains filtered or unexported fields
}
AWS Lambda Custom Runtime
func NewAWSLambdaCustomRuntime ¶
func NewAWSLambdaCustomRuntime(runtime AWSLambdaRuntime) *AWSLambdaCustomRuntime
Initialize AWSLambdaCustomRuntime
func (*AWSLambdaCustomRuntime) Invoke ¶
func (a *AWSLambdaCustomRuntime) Invoke() error
Invoke the runtime handler
type AWSLambdaRuntime ¶
type AWSLambdaRuntime interface {
// Setup before invoke the function handler.
Setup(env *AWSLambdaRuntimeEnvironemnt) error
// Invoke the function handler and return the result.
Invoke(event []byte, context *Context) (interface{}, error)
// Cleanup after invoke the function handler.
Cleanup(env *AWSLambdaRuntimeEnvironemnt)
}
AWSLambdaRuntime is interface of any runtime.
type AWSLambdaRuntimeEnvironemnt ¶
type AWSLambdaRuntimeEnvironemnt struct {
AWSLambdaRuntimeAPI string
LambdaTaskRoot string
Handler string
}
AWSLambdaRuntimeEnvironemnt is needy environment info for to invoke handler
type AWSLambdaRuntimeError ¶
type AWSLambdaRuntimeError struct {
ErrorMessage string `json:"errorMessage"`
ErrorType string `json:"errorType"`
StackTrace []string `json:"stackTrace"`
}
AWSLambdaRuntimeError is error of AWS Lambda runtime error.
func (AWSLambdaRuntimeError) Error ¶
func (a AWSLambdaRuntimeError) Error() string
type Context ¶
type Context struct {
// The request ID, which identifies the request that triggered the function invocation.
// // example
// "8476a536-e9f4-11e8-9739-2dfe598c3fcd"
RequestID string
// The date that the function times out in Unix time milliseconds.
// // example
// "1542409706888"
DeadlineMs string
// The ARN of the Lambda function, version, or alias that's specified in the invocation.
// // example
// "arn:aws:lambda:us-east-2:123456789012:function:custom-runtime"
InvokedFunctionArn string
// AWS X-Ray tracing header.
// // example
// "Root=1-5bef4de7-ad49b0e87f6ef6c87fc2e700;Parent=9a9197af755a6419;Sampled=1"
TraceID string
// For invocations from the AWS Mobile SDK, data about the client application and device.
ClientContext string
// For invocations from the AWS Mobile SDK, data about the Amazon Cognito identity provider.
CognitoIdentity string
AWSLambdaRuntimeEnvironemnt
}
Context is AWS Lambda event.
Click to show internal directories.
Click to hide internal directories.