Documentation
¶
Index ¶
- func Run(handler Handler, events ...EventType) error
- type Client
- func (e *Client) ExitError(ctx context.Context, errorType string) (*StatusResponse, error)
- func (c *Client) ExtensionID() string
- func (e *Client) InitError(ctx context.Context, errorType string) (*StatusResponse, error)
- func (e *Client) Name() string
- func (e *Client) NextEvent(ctx context.Context) (*Event, error)
- func (e *Client) Register(events ...EventType) (*Register, error)
- type Event
- type EventType
- type Handler
- type Register
- type StatusResponse
- type Tracing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a simple client for the Lambda Extensions API
func (*Client) ExitError ¶
ExitError reports an error to the platform before exiting. Call it when you encounter an unexpected failure
func (*Client) ExtensionID ¶
func (*Client) InitError ¶
InitError reports an initialization error to the platform. Call it when you registered but failed to initialize
type Event ¶
type Event struct {
EventType EventType `json:"eventType"`
DeadlineMs int64 `json:"deadlineMs"`
RequestID string `json:"requestId"`
InvokedFunctionArn string `json:"invokedFunctionArn"`
Tracing Tracing `json:"tracing"`
}
Event is the response for /event/next
type EventType ¶
type EventType string
EventType represents the type of events recieved from /event/next
type Register ¶
type Register struct {
FunctionName string `json:"functionName"`
FunctionVersion string `json:"functionVersion"`
Handler string `json:"handler"`
ExtensionID string
}
Register is the body of the response for /register
type StatusResponse ¶
type StatusResponse struct {
Status string `json:"status"`
}
StatusResponse is the body of the response for /init/error and /exit/error
Click to show internal directories.
Click to hide internal directories.