Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FatalNoAPIKey is the error reported to the AWS Extension environment when // no API key has been set. Unused until we can report error // without stopping the extension. FatalNoAPIKey ErrorEnum = "Fatal.NoAPIKey" // FatalDogstatsdInit is the error reported to the AWS Extension environment when // DogStatsD fails to initialize properly. Unused until we can report error // without stopping the extension. FatalDogstatsdInit ErrorEnum = "Fatal.DogstatsdInit" // FatalBadEndpoint is the error reported to the AWS Extension environment when // bad endpoints have been configured. Unused until we can report error // without stopping the extension. FatalBadEndpoint ErrorEnum = "Fatal.BadEndpoint" // FatalConnectFailed is the error reported to the AWS Extension environment when // a connection failed. FatalConnectFailed ErrorEnum = "Fatal.ConnectFailed" // Invoke event Invoke RuntimeEvent = "INVOKE" // Shutdown event Shutdown RuntimeEvent = "SHUTDOWN" // Timeout is one of the possible ShutdownReasons Timeout ShutdownReason = "timeout" )
Variables ¶
This section is empty.
Functions ¶
func ReportInitError ¶
func ReportInitError(id registration.ID, errorEnum ErrorEnum) error
ReportInitError reports an init error to the environment.
func WaitForNextInvocation ¶
func WaitForNextInvocation(stopCh chan struct{}, daemon *daemon.Daemon, id registration.ID) error
WaitForNextInvocation makes a blocking HTTP call to receive the next event from AWS. Note that for now, we only subscribe to INVOKE and SHUTDOWN events. Write into stopCh to stop the main thread of the running program.
Types ¶
type ErrorEnum ¶
type ErrorEnum string
ErrorEnum are errors reported to the AWS Extension environment.
type InvocationHandler ¶
type InvocationHandler func(doneChannel chan bool, daemon *daemon.Daemon, arn string, requestID string)
InvocationHandler is the invocation handler signature
type Payload ¶
type Payload struct { EventType RuntimeEvent `json:"eventType"` DeadlineMs int64 `json:"deadlineMs"` InvokedFunctionArn string `json:"invokedFunctionArn"` ShutdownReason ShutdownReason `json:"shutdownReason"` RequestID string `json:"requestId"` }
Payload is the payload read in the response while subscribing to the AWS Extension env.
type ShutdownReason ¶
type ShutdownReason string
ShutdownReason is an AWS Shutdown reason
func (ShutdownReason) String ¶
func (s ShutdownReason) String() string
String returns the string value for this ShutdownReason.
Click to show internal directories.
Click to hide internal directories.