Documentation ¶
Index ¶
- Constants
- type Context
- func (ctx *Context) Abort()
- func (ctx *Context) Base64(statusCode int, body []byte) (interface{}, error)
- func (ctx *Context) Deadline() (deadline time.Time, ok bool)
- func (ctx *Context) Done() <-chan struct{}
- func (ctx *Context) Err() error
- func (ctx *Context) Get(key string) (interface{}, bool)
- func (ctx *Context) IsAborted() bool
- func (ctx *Context) JSON(statusCode int, body interface{}) (interface{}, error)
- func (ctx *Context) MustGet(key string) interface{}
- func (ctx *Context) Next() (res interface{}, err error)
- func (ctx *Context) Return(res interface{}) (interface{}, error)
- func (ctx *Context) Set(key string, value interface{})
- func (ctx *Context) String(statusCode int, body string) (interface{}, error)
- func (ctx *Context) Value(key interface{}) interface{}
- type ErrHandler
- type H
- type Handler
- type Lambda
- func (l *Lambda) Handle(handler Handler) *Lambda
- func (l *Lambda) Invoke(parent context.Context, payload []byte) (out []byte, err error)
- func (l *Lambda) SetErrHandler(handler ErrHandler) *Lambda
- func (l *Lambda) Use(handlers ...Handler) *Lambda
- func (l *Lambda) With(key string, value interface{}) *Lambda
- type Payload
Constants ¶
View Source
const ( MIMEApplicationJSON = "application/json" MIMEApplicationJSONCharsetUTF8 = MIMEApplicationJSON + "; " + charsetUTF8 MIMETextPlain = "text/plain" MIMETextPlainCharsetUTF8 = MIMETextPlain + "; " + charsetUTF8 )
View Source
const (
HeaderContentType = "Content-Type"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Payload Payload Keys map[string]interface{} // contains filtered or unexported fields }
type ErrHandler ¶
var DefaultErrHandler ErrHandler = func(err error, ctx *Context) (interface{}, error) { return &events.APIGatewayProxyResponse{ StatusCode: http.StatusInternalServerError, Body: http.StatusText(http.StatusInternalServerError) + ": " + err.Error(), }, nil }
type Lambda ¶
type Lambda struct {
// contains filtered or unexported fields
}
func (*Lambda) SetErrHandler ¶
func (l *Lambda) SetErrHandler(handler ErrHandler) *Lambda
type Payload ¶
type Payload []byte
func (Payload) AsRequest ¶
func (p Payload) AsRequest() *events.APIGatewayProxyRequest
func (Payload) AsWsRequest ¶
func (p Payload) AsWsRequest() *events.APIGatewayWebsocketProxyRequest
func (Payload) MustUnmarshal ¶
func (p Payload) MustUnmarshal(dst interface{}) interface{}
Click to show internal directories.
Click to hide internal directories.