-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathoptions.go
37 lines (30 loc) · 1.03 KB
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package algnhsa
type RequestType int
const (
RequestTypeAuto RequestType = iota
RequestTypeAPIGatewayV1
RequestTypeAPIGatewayV2
RequestTypeALB
)
// Options holds the optional parameters.
type Options struct {
// RequestType sets the expected request type.
// By default, algnhsa deduces the request type from the lambda function payload.
RequestType RequestType
// BinaryContentTypes sets content types that should be treated as binary types.
// The "*/* value makes algnhsa treat any content type as binary.
BinaryContentTypes []string
binaryContentTypeMap map[string]bool
// Use API Gateway PathParameters["proxy"] when constructing the request url.
// Strips the base path mapping when using a custom domain with API Gateway.
UseProxyPath bool
// DebugLog enables printing request and response objects to stdout.
DebugLog bool
}
func (opts *Options) setBinaryContentTypeMap() {
types := map[string]bool{}
for _, contentType := range opts.BinaryContentTypes {
types[contentType] = true
}
opts.binaryContentTypeMap = types
}