Move some request parsing into hook package

Trying to simplify hookHandler.  No functional changes introduced.
This commit is contained in:
Cameron Moore 2020-11-17 15:00:58 -06:00
parent 4fadb1171f
commit 22c8a1670b
3 changed files with 125 additions and 69 deletions

View file

@ -17,7 +17,6 @@ import (
"log"
"math"
"net"
"net/http"
"net/textproto"
"os"
"reflect"
@ -48,30 +47,6 @@ const (
EnvNamespace string = "HOOK_"
)
// Request represents a webhook request.
type Request struct {
// The request ID set by the RequestID middleware.
ID string
// The Content-Type of the request.
ContentType string
// The raw request body.
Body []byte
// Headers is a map of the parsed headers.
Headers map[string]interface{}
// Query is a map of the parsed URL query values.
Query map[string]interface{}
// Payload is a map of the parsed payload.
Payload map[string]interface{}
// The underlying HTTP request.
RawRequest *http.Request
}
// ParameterNodeError describes an error walking a parameter node.
type ParameterNodeError struct {
key string