api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTENT_TYPE = "application/json"
)

Variables

This section is empty.

Functions

func Response

func Response(status int, body interface{}) *events.APIGatewayProxyResponse

Response returns a response to be returned by the API Gateway Request.

func StatusBadRequest

func StatusBadRequest(err error) (*events.APIGatewayProxyResponse, error)

StatusBadRequest returns a response of an HTTP StatusBadRequest and an error message.

func StatusBadRequestWithBody

func StatusBadRequestWithBody(body map[string]interface{}) (*events.APIGatewayProxyResponse, error)

StatusBadRequestWithBody returns a response of an HTTP StatusBadRequest with body.

func StatusInternalServerError

func StatusInternalServerError(err error) (*events.APIGatewayProxyResponse, error)

StatusInternalServerError returns a response of an HTTP StatusInternalServerError.

func StatusOK

func StatusOK(body interface{}) (*events.APIGatewayProxyResponse, error)

StatusOK returns a response of an HTTP StatusOK with body.

func StatusOKWithoutBody

func StatusOKWithoutBody() (*events.APIGatewayProxyResponse, error)

StatusOKWithoutBody returns a response of an HTTP StatusOK without body.

func StatusUnhandledMethod

func StatusUnhandledMethod() (*events.APIGatewayProxyResponse, error)

StatusUnhandledMethod returns a response of an HTTP StatusMethodNotAllowed and an error message of unhandled method.

func StatusUnhandledRequest

func StatusUnhandledRequest(err error) (*events.APIGatewayProxyResponse, error)

StatusUnhandledRequest returns a response of an HTTP StatusNotImplemented and an error message.

Types

type Message

type Message struct {
	Custom string `json:"message,omitempty"`
	Error  string `json:"error,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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