render

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderError

func RenderError(w http.ResponseWriter, status int, err error, opts *ErrorOptions)

func RenderJSON

func RenderJSON(w http.ResponseWriter, status int, data interface{})

Types

type ErrorOptions

type ErrorOptions struct {
	Code *int `json:"code,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
	Code  *int   `json:"code,omitempty"`
}

type Response

type Response struct {
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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