handler

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

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 NewHTTP

func NewHTTP(logger logging.Logger, server http.Handler, port string) *HTTPHandler

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 (*LambdaHandler) Serve

func (lh *LambdaHandler) Serve()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL