File: request_response_funcs.go

package info (click to toggle)
golang-github-go-kit-kit 0.13.0-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,784 kB
  • sloc: sh: 22; makefile: 11
file content (21 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package awslambda

import (
	"context"
)

// HandlerRequestFunc may take information from the received
// payload and use it to place items in the request scoped context.
// HandlerRequestFuncs are executed prior to invoking the endpoint and
// decoding of the payload.
type HandlerRequestFunc func(ctx context.Context, payload []byte) context.Context

// HandlerResponseFunc may take information from a request context
// and use it to manipulate the response before it's marshaled.
// HandlerResponseFunc are executed after invoking the endpoint
// but prior to returning a response.
type HandlerResponseFunc func(ctx context.Context, response interface{}) context.Context

// HandlerFinalizerFunc is executed at the end of Invoke.
// This can be used for logging purposes.
type HandlerFinalizerFunc func(ctx context.Context, resp []byte, err error)