registration

package
v0.0.0-...-45b38f9 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//HeaderExtID is the header name for the extension identifier
	HeaderExtID = "Lambda-Extension-Identifier"
)

Variables

This section is empty.

Functions

func BuildURL

func BuildURL(route string) string

BuildURL returns the full url based on the route

func EnableTelemetryCollection

func EnableTelemetryCollection(args EnableTelemetryCollectionArgs) error

EnableTelemetryCollection enables telemetry collections via AWS Telemetry API

func NextUrl

func NextUrl() string

NextUrl returns the /next endpoint

func NoOpProcessEvent

func NoOpProcessEvent(ctx context.Context, id ID) error

NoOpProcessEvent conforms to the Lambda Runtime API but act as a no-op this is required NOT to fail the extension (and customer code) when no api key has been set

func RegisterExtension

func RegisterExtension(registrationRoute string, timeout time.Duration) (ID, FunctionARN, error)

RegisterExtension registers the serverless daemon and subscribe to INVOKE and SHUTDOWN messages. Returns either (the serverless ID assigned by the serverless daemon + the api key as read from the environment) or an error.

Types

type EnableTelemetryCollectionArgs

type EnableTelemetryCollectionArgs struct {
	ID                  ID
	RegistrationURL     string
	RegistrationTimeout time.Duration
	LogsType            string
	Port                int
	CollectionRoute     string
	Timeout             int
	MaxBytes            int
	MaxItems            int
}

EnableTelemetryCollectionArgs is the set of arguments used to call EnableTelemetryCollection

type FunctionARN

type FunctionARN string

FunctionARN is the ARN of the Lambda function

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient represents an Http Client

type ID

type ID string

ID is the extension ID within the AWS Lambda environment.

func (ID) String

func (i ID) String() string

String returns the string value for this ID.

type TelemetrySubscriptionPayload

type TelemetrySubscriptionPayload struct {
	Buffering     buffering   `json:"buffering"`
	Destination   destination `json:"destination"`
	Types         []string    `json:"types"`
	SchemaVersion string      `json:"schemaVersion"`
}

TelemetrySubscriptionPayload is the payload we send while subscribing to the AWS Telemetry API

func (*TelemetrySubscriptionPayload) MarshalJSON

func (p *TelemetrySubscriptionPayload) MarshalJSON() ([]byte, error)

MarshalJSON marshals the given TelemetrySubscriptionPayload object

Jump to

Keyboard shortcuts

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