serverless

package
Version: v0.0.0-...-2956337 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

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.

func (ErrorEnum) String

func (e ErrorEnum) String() string

String returns the string value for this ErrorEnum.

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 RuntimeEvent

type RuntimeEvent string

RuntimeEvent is an AWS Runtime event

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.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL