models

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 13 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 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 ErrorInfosToAwsAPIGatewayProxyResponse added in v0.2.2

func ErrorInfosToAwsAPIGatewayProxyResponse(errs ...ErrorInfo) events.APIGatewayProxyResponse

func GetMapString2Simple added in v0.2.2

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

Types

type AwsAPIGatewayProxyOutput

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

func ErrorInfosToAwsAPIGatewayProxyOutput added in v0.2.2

func ErrorInfosToAwsAPIGatewayProxyOutput(errs ...ErrorInfo) AwsAPIGatewayProxyOutput

func ErrorInfosToAlexaResponse(errs ...ErrorInfo) AwsAPIGatewayProxyOutput {

type ErrorInfo

type ErrorInfo struct {
	StatusCode int
	Body       []byte
}

func ErrorsInfoToResponseInfo added in v0.2.2

func ErrorsInfoToResponseInfo(errs ...ErrorInfo) ErrorInfo

type HookData

type HookData struct {
	InputType     string
	InputBody     []byte
	OutputType    string
	OutputURL     string
	OutputNames   []string
	Token         string
	InputMessage  []byte
	OutputMessage cc.Message
}

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
)

Jump to

Keyboard shortcuts

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