api

package
v0.0.0-...-c57a2f4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: AGPL-3.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, errorCode int, reason string)

func JSONErrorResponse

func JSONErrorResponse(w http.ResponseWriter, errorCode int, err error)

func RenderJSONOrStringError

func RenderJSONOrStringError(w http.ResponseWriter, errorCode int, err error)

func SanitizeJSON

func SanitizeJSON(s []byte) ([]byte, error)

func SanitizeProtobuf

func SanitizeProtobuf(jsonEncodedProtobuf string, m proto.Message) ([]byte, error)

func SanitizedResponse

func SanitizedResponse(w http.ResponseWriter, response string)

func SanitizedResponseM

func SanitizedResponseM(w http.ResponseWriter, response string, m proto.Message)

Types

type Gateway

type Gateway struct {
	// contains filtered or unexported fields
}

Gateway represents an HTTP API gateway

func NewGateway

func NewGateway(n *