models

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryParamOutputAdapters = "adapters"
	QueryParamInputType      = "inputType"
	QueryParamOutputType     = "outputType"
	QueryParamToken          = "token"
	QueryParamOutputURL      = "url"
)

Variables

This section is empty.

Functions

func BodyToMessageBytesAnyHTTP added in v0.4.0

func BodyToMessageBytesAnyHTTP(bodyType MessageBodyType, aReq anyhttp.Request) []byte

func BodyToMessageBytesFastHTTP

func BodyToMessageBytesFastHTTP(bodyType MessageBodyType, ctx *fasthttp.RequestCtx) []byte

func BodyToMessageBytesNetHTTP added in v0.2.2

func BodyToMessageBytesNetHTTP(bodyType MessageBodyType, req *http.Request) []byte

func BuildAwsAPIGatewayProxyResponse added in v0.3.0

func BuildAwsAPIGatewayProxyResponse(hookData HookData, errs ...ErrorInfo) (events.APIGatewayProxyResponse, error)

func GetMapString2Simple added in v0.2.2

func GetMapString2Simple(mapSS map[string]string, key string) string

func GetMaxStatusCode added in v0.3.0

func GetMaxStatusCode(errs ...ErrorInfo) int

Types

type AwsAPIGatewayProxyOutput

type AwsAPIGatewayProxyOutput struct {
	IsBase64Encoded bool              `json:"isBase64Encoded"`
	StatusCode      int               `json:"statusCode"`
	Body            string            `json:"body"`
	Headers         map[string]string `json:"headers"`
}

type ErrorInfo

type ErrorInfo struct {
	StatusCode int
	Body       []byte
}

func ErrorsInfoToResponseInfoOld added in v0.3.0

func ErrorsInfoToResponseInfoOld(errs ...ErrorInfo) ErrorInfo

type HookData

type HookData struct {
	InputType        string     `json:"inputType,omitempty"`
	InputBody        []byte     `json:"inputBody,omitempty"`
	OutputType       string     `json:"outputType,omitempty"`
	OutputURL        string     `json:"outputUrl,omitempty"`
	OutputNames      []string   `json:"outputNames,omitempty"`
	Token            string     `json:"token,omitempty"`
	InputMessage     []byte     `json:"inputMessage,omitempty"`
	CanonicalMessage cc.Message `json:"canonicalMessage,omitempty"`
}

func HookDataFromAnyHTTPReq added in v0.4.0

func HookDataFromAnyHTTPReq(bodyType MessageBodyType, aReq anyhttp.Request) HookData

func HookDataFromAwsLambdaEvent added in v0.2.2

func HookDataFromAwsLambdaEvent(bodyType MessageBodyType, awsReq events.APIGatewayProxyRequest) HookData

func HookDataFromEawsyLambdaEvent

func HookDataFromEawsyLambdaEvent(bodyType MessageBodyType, eawsyReq *apigatewayproxyevt.Event) HookData

func HookDataFromFastHTTPReqCtx

func HookDataFromFastHTTPReqCtx(bodyType MessageBodyType, ctx *fasthttp.RequestCtx) HookData

func HookDataFromNetHTTPReq added in v0.2.2

func HookDataFromNetHTTPReq(bodyType MessageBodyType, req *http.Request) HookData

type MessageBodyType

type MessageBodyType int
const (
	JSON MessageBodyType = iota
	URLEncoded
	URLEncodedJSONPayload
	URLEncodedJSONPayloadOrJSON
)

type RequestParams added in v0.3.0

type RequestParams struct {
	InputType  string `url:"inputType"`
	OutputType string `url:"outputType"`
	Token      string `url:"token"`
	URL        string `url:"url"`
}

type ResponseInfo added in v0.3.0

type ResponseInfo struct {
	HookData   HookData    `json:"hookData,omitempty"`
	Responses  []ErrorInfo `json:"responses,omitempty"`
	StatusCode int         `json:"statusCode,omitempty"`
}

func (*ResponseInfo) ToAPIGatewayProxyResponse added in v0.3.0

func (ri *ResponseInfo) ToAPIGatewayProxyResponse() (events.APIGatewayProxyResponse, error)

Jump to

Keyboard shortcuts

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