directinvoke

package
v0.0.0-...-6be47e1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvokeIDHeader                   = "Invoke-Id"
	InvokedFunctionArnHeader         = "Invoked-Function-Arn"
	VersionIDHeader                  = "Invoked-Function-Version"
	ReservationTokenHeader           = "Reservation-Token"
	CustomerHeadersHeader            = "Customer-Headers"
	ContentTypeHeader                = "Content-Type"
	MaxPayloadSizeHeader             = "MaxPayloadSize"
	InvokeResponseModeHeader         = "InvokeResponseMode"
	ResponseBandwidthRateHeader      = "ResponseBandwidthRate"
	ResponseBandwidthBurstSizeHeader = "ResponseBandwidthBurstSize"
	FunctionResponseModeHeader       = "Lambda-Runtime-Function-Response-Mode"

	ErrorTypeHeader = "Error-Type"

	EndOfResponseTrailer     = "End-Of-Response"
	FunctionErrorTypeTrailer = "Lambda-Runtime-Function-Error-Type"
	FunctionErrorBodyTrailer = "Lambda-Runtime-Function-Error-Body"
)
View Source
const (
	EndOfResponseComplete  = "Complete"
	EndOfResponseTruncated = "Truncated"
	EndOfResponseOversized = "Oversized"
)
View Source
const DefaultRefillIntervalMs = 125 // default refill interval in milliseconds

Variables

InvokeResponseMode controls the context in which the invoke is. Since this was introduced in Streaming invokes, we default it to Buffered.

View Source
var MaxDirectResponseSize int64 = interop.MaxPayloadSize // this is intentionally not a constant so we can configure it via CLI
View Source
var ResetReasonMap = map[string]fatalerror.ErrorType{
	"failure": fatalerror.SandboxFailure,
	"timeout": fatalerror.SandboxTimeout,
}
View Source
var ResponseBandwidthBurstSize int64 = interop.ResponseBandwidthBurstSize
View Source
var ResponseBandwidthRate int64 = interop.ResponseBandwidthRate

Functions

func ReceiveDirectInvoke

func ReceiveDirectInvoke(w http.ResponseWriter, r *http.Request, token interop.Token) (*interop.Invoke, error)

ReceiveDirectInvoke parses invoke and verifies it against Token message. Uses deadline provided by Token Renders BadRequest in case of error

func SendDirectInvokeResponse

func SendDirectInvokeResponse(additionalHeaders map[string]string, payload io.Reader, trailers http.Header,
	w http.ResponseWriter, interruptedResponseChan chan *interop.Reset,
	sendResponseChan chan *interop.InvokeResponseMetrics, request *interop.CancellableRequest, runtimeCalledResponse bool, invokeID string) error

Types

type CancellableWriter

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

func NewCancellableWriter

func NewCancellableWriter(w io.Writer) (*CancellableWriter, context.CancelFunc)

func (*CancellableWriter) Write

func (w *CancellableWriter) Write(p []byte) (int, error)

type CopyDoneResult

type CopyDoneResult struct {
	Metrics *interop.InvokeResponseMetrics
	Error   error
}

type CustomerHeaders

type CustomerHeaders struct {
	CognitoIdentityID     string `json:"Cognito-Identity-Id"`
	CognitoIdentityPoolID string `json:"Cognito-Identity-Pool-Id"`
	ClientContext         string `json:"Client-Context"`
}

func (CustomerHeaders) Dump

func (s CustomerHeaders) Dump() string

func (*CustomerHeaders) Load

func (s *CustomerHeaders) Load(in string) error

type FlushingWriter

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

func NewFlushingWriter

func NewFlushingWriter(w io.Writer) (*FlushingWriter, error)

func (*FlushingWriter) Write

func (w *FlushingWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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