Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Host is the host of HTTP server
Host = "127.0.0.1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIGatewayRequest ¶
type APIGatewayRequest struct { Headers map[string]string `json:"headers"` Method string `json:"httpMethod"` Path string `json:"path"` QueryString map[string]interface{} `json:"queryString"` Body string `json:"body"` Context APIGatewayRequestContext `json:"requestContext"` }
APIGatewayRequest represents an API gateway request
type APIGatewayRequestContext ¶
type APIGatewayRequestContext struct { ServiceID string `json:"serviceId"` RequestID string `json:"requestId"` Method string `json:"httpMethod"` Path string `json:"path"` SourceIP string `json:"sourceIp"` Stage string `json:"stage"` Identity struct { SecretID *string `json:"secretId"` } `json:"identity"` }
APIGatewayRequestContext represents a request context
type APIGatewayResponse ¶
type APIGatewayResponse struct { IsBase64Encoded bool `json:"isBase64Encoded"` StatusCode int `json:"statusCode"` Headers map[string]string `json:"headers"` Body string `json:"body"` }
APIGatewayResponse represents a API gateway response
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler represents a request handler
func (*Handler) Handle ¶
func (h *Handler) Handle(ctx context.Context, r *APIGatewayRequest) (*APIGatewayResponse, error)
Handle processes the incoming request
func (*Handler) WithBinaryMIMETypes ¶
WithBinaryMIMETypes allows user to specify MIME types that should be base64 encoded
Click to show internal directories.
Click to hide internal directories.