apigenutil

package
v1.29.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildErr

func BuildErr(code, msg string) *Statement

BuildErr returns an expression for returning an encore.dev/beta/errs.Error with the given code and message.

func BuildErrf

func BuildErrf(code, format string, args ...Code) *Statement

BuildErrf is like BuildErr but with a format string.

func DecodeBody added in v1.20.1

func DecodeBody(g *Group, ioReaderExpr *Statement, paramsExpr *Statement, dec *genutil.TypeUnmarshaller, params []*apienc.ParameterEncoding)

DecodeBody decodes an io.Reader request body into the given parameters.

func DecodeCookie added in v1.16.0

func DecodeCookie(errs *perr.List, g *Group, httpReqExpr, paramExpr *Statement, dec *genutil.TypeUnmarshaller, params []*apienc.ParameterEncoding)

DecodeCookie is like DecodeHeaders but for cookies.

func DecodeHeaders

func DecodeHeaders(g *Group, httpHeaderExpr, paramExpr *Statement, dec *genutil.TypeUnmarshaller, params []*apienc.ParameterEncoding)

DecodeHeaders generates code for decoding HTTP headers from the http request given by httpReqExpr and storing the result into the params given by paramsExpr.

func DecodeQuery

func DecodeQuery(g *Group, urlValuesExpr, paramExpr *Statement, dec *genutil.TypeUnmarshaller, params []*apienc.ParameterEncoding)

DecodeQuery is like DecodeHeaders but for query strings.

func EncodeBody added in v1.20.1

func EncodeBody(gu *genutil.Helper, g *Group, streamExpr, paramExpr *Statement, params []*apienc.ParameterEncoding)

EncodeBody encodes a request body into the given *jsoniter.Stream.

func EncodeHeaders added in v1.20.1

func EncodeHeaders(errs *perr.List, g *Group, httpHeaderExpr, paramExpr *Statement, params []*apienc.ParameterEncoding)

EncodeHeaders generates code for encoding HTTP headers into a http.Header map.

func EncodeQuery added in v1.20.1

func EncodeQuery(errs *perr.List, g *Group, urlValuesExpr, paramExpr *Statement, params []*apienc.ParameterEncoding)

EncodeQuery generates code for encoding URL query values into a url.Values map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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