lambdautil

package
v0.0.0-...-82ab749 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieName = "csrf"
	FieldName  = "csrf"
)

Variables

This section is empty.

Functions

func CSRFCookie

func CSRFCookie(event *events.APIGatewayProxyRequest) string

func CSRFCookie2

func CSRFCookie2(event *events.APIGatewayV2HTTPRequest) string
func Cookie(headers map[string][]string, name string) *http.Cookie

func Cookie2

func Cookie2(cookies []string, name string) *http.Cookie

func Cookies

func Cookies(headers map[string][]string) []*http.Cookie

func Cookies2

func Cookies2(cookies []string) []*http.Cookie

func ErrorResponse

func ErrorResponse(err error) (*events.APIGatewayProxyResponse, error)

func ErrorResponse2

func ErrorResponse2(err error) (*events.APIGatewayV2HTTPResponse, error)

func ErrorResponseJSON

func ErrorResponseJSON(statusCode int, err error) (*events.APIGatewayProxyResponse, error)

func ErrorResponseJSON2

func ErrorResponseJSON2(statusCode int, err error) (*events.APIGatewayV2HTTPResponse, error)

func EventBody

func EventBody(event *events.APIGatewayProxyRequest) (string, error)

func EventBody2

func EventBody2(event *events.APIGatewayV2HTTPRequest) (string, error)

func EventBodyBuffer

func EventBodyBuffer(event *events.APIGatewayProxyRequest) (*bytes.Buffer, error)

func EventBodyBuffer2

func EventBodyBuffer2(event *events.APIGatewayV2HTTPRequest) (*bytes.Buffer, error)

func Location

func Location(event *events.APIGatewayV2HTTPRequest, query url.Values) string

func PreventCSRF

func PreventCSRF(body url.Values, event *events.APIGatewayProxyRequest) error

func PreventCSRF2

func PreventCSRF2(body url.Values, event *events.APIGatewayV2HTTPRequest) error

func RenderHTML

func RenderHTML(html string, v interface{}) (string, error)

func SingleToMultiValue

func SingleToMultiValue(m map[string]string) url.Values

SingleToMultiValue takes the API Gateway-provided map[string]string representations of headers, query string parameters, etc. and turns them into url.Values (which is a map[string][]string with more methods) that is actually useful for constructing and manipulating URLs and requests.

func Static

func Static(contentType, body string) (*events.APIGatewayV2HTTPResponse, error)

Types

type CSRFError

type CSRFError struct{}

func (CSRFError) Error

func (CSRFError) Error() string

Jump to

Keyboard shortcuts

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