File: encode_decode.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 (16 lines) | stat: -rw-r--r-- 522 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package awslambda

import (
	"context"
)

// DecodeRequestFunc extracts a user-domain request object from an
// AWS Lambda payload.
type DecodeRequestFunc func(context.Context, []byte) (interface{}, error)

// EncodeResponseFunc encodes the passed response object into []byte,
// ready to be sent as AWS Lambda response.
type EncodeResponseFunc func(context.Context, interface{}) ([]byte, error)

// ErrorEncoder is responsible for encoding an error.
type ErrorEncoder func(ctx context.Context, err error) ([]byte, error)