From 970f751fe60b67705836982aeac1cdac0a9f132e Mon Sep 17 00:00:00 2001 From: Bryan Moffatt Date: Fri, 7 Apr 2023 15:46:56 -0700 Subject: [PATCH] update docs --- events/lambda_function_urls.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/events/lambda_function_urls.go b/events/lambda_function_urls.go index 16eb5960..bef9869d 100644 --- a/events/lambda_function_urls.go +++ b/events/lambda_function_urls.go @@ -68,17 +68,20 @@ type LambdaFunctionURLResponse struct { Cookies []string `json:"cookies"` } -// LambdaFunctionURLStreamingResponse models the response to a Lambda Function URL -// used when MODE is TBD -// If the MODE of the Function URL is TBD, use LambdaFunctionURLResponse instead +// LambdaFunctionURLStreamingResponse models the response to a Lambda Function URL when InvokeMode is RESPONSE_STREAM. +// If the InvokeMode of the Function URL is BUFFERED (default), use LambdaFunctionURLResponse instead. // -// example: -// -// lambda.Start(func(LambdaFunctionURL) (*events.LambdaFunctionURLStreamingResponse, error) { -// return *LambdaFunctionURLStreamingResponse{ +// Example: // +// lambda.Start(func() (*events.LambdaFunctionURLStreamingResponse, error) { +// return &events.LambdaFunctionURLStreamingResponse{ +// StatusCode: 200, +// Headers: map[string]string{ +// "Content-Type": "text/html", +// }, +// Body: strings.NewReader("Hello World!"), // }, nil -// }) +// }) type LambdaFunctionURLStreamingResponse struct { prelude *bytes.Buffer