render

package
v0.0.0-...-3bba280 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package render renders HTTP responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(rw http.ResponseWriter, code int, val any)

JSON renders a JSON response.

func JSONError

func JSONError(rw http.ResponseWriter, code int, status string)

JSONError renders a JSON error response.

Types

type Error

type Error struct {
	Code    int    `json:"errno"`
	Message string `json:"error"`
}

Error represents a JSON response error.

Jump to

Keyboard shortcuts

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