render

package
v1.6.7-0...-b28dd99 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequestError

func BadRequestError(w http.ResponseWriter, msg string)

BadRequestError helper.

func ForbiddenError

func ForbiddenError(w http.ResponseWriter, msg string)

ForbiddenError helper.

func InternalServerError

func InternalServerError(w http.ResponseWriter, msg string)

InternalServerError helper.

func JSON

func JSON(w http.ResponseWriter, status int, v interface{})

JSON render encodes given data to JSON and writes it to response.

func NotFoundError

func NotFoundError(w http.ResponseWriter, msg string)

NotFoundError helper.

func UnathorizedError

func UnathorizedError(w http.ResponseWriter, msg string)

UnathorizedError helper.

Types

type BoolResponse

type BoolResponse struct {
	Status bool `json:"status"`
}

type Empty

type Empty struct{}

Empty represents an empty response.

type Error

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

Error represents a JSON encoded API error.

Jump to

Keyboard shortcuts

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