lambdaext

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a simple client for the Lambda Extensions API

func NewClient

func NewClient(awsLambdaRuntimeAPI string) *Client

NewClient returns a Lambda Extensions API client

func (*Client) NextEvent

func (e *Client) NextEvent(ctx context.Context) (*NextEventResponse, error)

NextEvent blocks while long polling for the next lambda invoke or shutdown

func (*Client) Register

func (e *Client) Register(ctx context.Context, filename string) (*RegisterResponse, error)

Register will register the extension with the Extensions API

type EventType

type EventType string

EventType represents the type of events recieved from /event/next

const (
	// Invoke is a lambda invoke
	Invoke EventType = "INVOKE"

	// Shutdown is a shutdown event for the environment
	Shutdown EventType = "SHUTDOWN"
)

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 Tracing

type Tracing struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

Tracing is part of the response for /event/next

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL