Documentation ¶
Index ¶
- Constants
- func BodyToMessageBytesAnyHTTP(bodyType MessageBodyType, aReq anyhttp.Request) []byte
- func BodyToMessageBytesFastHTTP(bodyType MessageBodyType, ctx *fasthttp.RequestCtx) []byte
- func BodyToMessageBytesNetHTTP(bodyType MessageBodyType, req *http.Request) []byte
- func BuildAwsAPIGatewayProxyResponse(hookData HookData, errs ...ErrorInfo) (events.APIGatewayProxyResponse, error)
- func GetMapString2Simple(mapSS map[string]string, key string) string
- func GetMaxStatusCode(errs ...ErrorInfo) int
- type AwsAPIGatewayProxyOutput
- type ErrorInfo
- type HookData
- func HookDataFromAnyHTTPReq(bodyType MessageBodyType, aReq anyhttp.Request) HookData
- func HookDataFromAwsLambdaEvent(bodyType MessageBodyType, awsReq events.APIGatewayProxyRequest, ...) HookData
- func HookDataFromFastHTTPReqCtx(bodyType MessageBodyType, ctx *fasthttp.RequestCtx) HookData
- func HookDataFromNetHTTPReq(bodyType MessageBodyType, req *http.Request) HookData
- type MessageBodyType
- type RequestParams
- type ResponseInfo
Constants ¶
View Source
const ( QueryParamOutputAdapters = config.ParamNameAdapters QueryParamInputType = config.ParamNameInputType QueryParamOutputFormat = config.ParamNameOutputFormat QueryParamOutputType = config.ParamNameOutputType QueryParamOutputURL = config.ParamNameOutputURL QueryParamToken = config.ParamNameToken ParamPayload = "payload" )
Variables ¶
This section is empty.
Functions ¶
func BodyToMessageBytesAnyHTTP ¶
func BodyToMessageBytesAnyHTTP(bodyType MessageBodyType, aReq anyhttp.Request) []byte
func BodyToMessageBytesFastHTTP ¶
func BodyToMessageBytesFastHTTP(bodyType MessageBodyType, ctx *fasthttp.RequestCtx) []byte
func BodyToMessageBytesNetHTTP ¶
func BodyToMessageBytesNetHTTP(bodyType MessageBodyType, req *http.Request) []byte
func BuildAwsAPIGatewayProxyResponse ¶
func BuildAwsAPIGatewayProxyResponse(hookData HookData, errs ...ErrorInfo) (events.APIGatewayProxyResponse, error)
func GetMaxStatusCode ¶
Types ¶
type ErrorInfo ¶
type HookData ¶
type HookData struct { InputType string `json:"inputType,omitempty"` InputBody []byte `json:"inputBody,omitempty"` OutputFormat string `json:"outputFormat,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"` CustomQueryParams url.Values `json:"customParams,omitempty"` CanonicalMessage commonchat.Message `json:"canonicalMessage,omitempty"` }
func HookDataFromAnyHTTPReq ¶
func HookDataFromAnyHTTPReq(bodyType MessageBodyType, aReq anyhttp.Request) HookData
func HookDataFromAwsLambdaEvent ¶
func HookDataFromAwsLambdaEvent(bodyType MessageBodyType, awsReq events.APIGatewayProxyRequest, messageBodyType MessageBodyType) HookData
HookDataFromAwsLambdaEvent converts a Lambda event to generic HookData.
func HookDataFromFastHTTPReqCtx ¶
func HookDataFromFastHTTPReqCtx(bodyType MessageBodyType, ctx *fasthttp.RequestCtx) HookData
func HookDataFromNetHTTPReq ¶
func HookDataFromNetHTTPReq(bodyType MessageBodyType, req *http.Request) HookData
type MessageBodyType ¶
type MessageBodyType int
const ( JSON MessageBodyType = iota URLEncoded URLEncodedJSONPayload URLEncodedJSONPayloadOrJSON URLEncodedRails )
type RequestParams ¶
type ResponseInfo ¶
type ResponseInfo struct { HookData HookData `json:"hookData,omitempty"` Responses []ErrorInfo `json:"responses,omitempty"` StatusCode int `json:"statusCode,omitempty"` }
func (*ResponseInfo) ToAPIGatewayProxyResponse ¶
func (ri *ResponseInfo) ToAPIGatewayProxyResponse() (events.APIGatewayProxyResponse, error)
Click to show internal directories.
Click to hide internal directories.