Documentation ¶
Overview ¶
Package handler defines a variety of handlers which are used to implement runtime interfaces for different environments. A handlers job is basically to take input from the environment, and translate it into the appropriate action for a service.
For example, an HTTP handler will receive an incoming HTTP request and use it to form a `Request` and then call `DoRequest` on the `Service`. It will also take the `Response` and form an appropriate HTTP response. The lambda handler does the same thing, but translates to/from events passed to the fold runtime by AWS Lambda.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPHandler ¶ added in v0.1.2
type HTTPHandler struct {
// contains filtered or unexported fields
}
func (*HTTPHandler) Serve ¶ added in v0.1.2
func (hh *HTTPHandler) Serve()
type HTTPRequestDoer ¶
type HTTPRequestDoer interface {
DoRequest(http.ResponseWriter, *http.Request)
}
type LambdaHandler ¶
type LambdaHandler struct {
// contains filtered or unexported fields
}
func NewLambda ¶
func NewLambda(logger logging.Logger, doer HTTPRequestDoer) *LambdaHandler
func (*LambdaHandler) Handle ¶
func (lh *LambdaHandler) Handle( ctx context.Context, e events.APIGatewayProxyRequest, ) (events.APIGatewayProxyResponse, error)
func (*LambdaHandler) Serve ¶
func (lh *LambdaHandler) Serve()
Click to show internal directories.
Click to hide internal directories.