Documentation
¶
Index ¶
- type Client
- func (e *Client) ExitError(ctx context.Context, errorType string) (res StatusResponse, err error)
- func (e *Client) InitError(ctx context.Context, errorType string) (res StatusResponse, err error)
- func (e *Client) NextEvent(ctx context.Context) (res NextEventResponse, err error)
- func (e *Client) RegisterExtension(ctx context.Context, filename string) (res RegisterResponse, err error)
- func (e *Client) SubscribeLogs(ctx context.Context, types []LogType, params SubscribeLogsParams) (res SubscribeResponse, err error)
- type EventType
- type LogType
- type NextEventResponse
- type RegisterResponse
- type StatusResponse
- type SubscribeLogsParams
- type SubscribeResponse
- type Tracing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ExtensionID string
// 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) InitError ¶
InitError reports an initialization error to the platform. Call it when you registered but failed to initialize
func (*Client) NextEvent ¶
func (e *Client) NextEvent(ctx context.Context) (res NextEventResponse, err error)
NextEvent blocks while long polling for the next lambda invoke or shutdown
func (*Client) RegisterExtension ¶
func (e *Client) RegisterExtension(ctx context.Context, filename string) (res RegisterResponse, err error)
RegisterExtension will register the extension with the Extensions API
func (*Client) SubscribeLogs ¶
func (e *Client) SubscribeLogs(ctx context.Context, types []LogType, params SubscribeLogsParams) (res SubscribeResponse, err error)
SubscribeLogs calls the Logs API to subscribe for the log events.
type EventType ¶
type EventType string
EventType represents the type of events received from /event/next
type NextEventResponse ¶
type NextEventResponse struct {
EventType EventType `json:"eventType"`
DeadlineMs int64 `json:"deadlineMs"`
RequestID string `json:"requestId"`
InvokedFunctionArn string `json:"invokedFunctionArn"`
Tracing Tracing `json:"tracing"`
}
NextEventResponse is the response for /event/next
type RegisterResponse ¶
type RegisterResponse struct {
FunctionName string `json:"functionName"`
FunctionVersion string `json:"functionVersion"`
Handler string `json:"handler"`
}
RegisterResponse 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
type SubscribeLogsParams ¶
type SubscribeResponse ¶
type SubscribeResponse struct {
// contains filtered or unexported fields
}
SubscribeResponse is the response body that is received from Logs API on subscribe