directinvoke

package
v0.0.0-...-bef5c4b Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	InvokeIDHeader                   = "Invoke-Id"
	TenantIDHeader                   = "Tenant-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