handler

package module
v0.0.0-...-3719ebb Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 2 Imported by: 2

README

Discord

Note: The canary branch is under heavy development – the stable release branch is master.

Usage

Documentation

Caught a Bug?

  1. Fork this repository to your own GitHub account and then clone it to your local device

As always, you should use yarn test to run the tests and see if your changes have broken anything.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	GraphqlClient *graphql.Client
	GetSecret     func(secretName string) (secretBytes []byte, err error)
	GetEnv        func(key string) (string, bool)
}

Context of the function call

type FunctionHandler

type FunctionHandler interface {
	Handle(req Request, context Context) (Response, error)
}

FunctionHandler used for a serverless Go method invocation

type Request

type Request struct {
	Body        []byte
	Header      http.Header
	QueryString string
	Method      string
}

Request of function call

type Response

type Response struct {

	// Body the body will be written back
	Body []byte

	// StatusCode needs to be populated with value such as http.StatusOK
	StatusCode int

	// Header is optional and contains any additional headers the function response should set
	Header http.Header
}

Response of function call

Jump to

Keyboard shortcuts

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