api

package
v0.0.0-...-f10e182 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAndValidate

func DecodeAndValidate(requestBody io.Reader, payload any) error

func ParseQueryParams

func ParseQueryParams(r *http.Request, payload any) error

func Respond

func Respond(w http.ResponseWriter, result any, statusCode ...int)

func ValidateRequestPayload

func ValidateRequestPayload(payload any) error

Types

type ErrorMessage

type ErrorMessage struct {
	Message string `json:"message"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []ErrorMessage `json:"errors"`
}

Jump to

Keyboard shortcuts

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