resp

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJSON

func WriteJSON(w http.ResponseWriter, code int, data any)

func WriteJSONFromError

func WriteJSONFromError(w http.ResponseWriter, err error)

func WriteJSONWithPaginate

func WriteJSONWithPaginate(w http.ResponseWriter, code int, data any, total int, page int, limit int)

Types

type DataPaginate

type DataPaginate struct {
	Data any  `json:"data"`
	Meta Meta `json:"meta"`
}

type Empty

type Empty struct{}

type HTTPError

type HTTPError struct {
	Message   string `json:"message"`
	RequestID string `json:"request_id"`
}

type Meta

type Meta struct {
	Page      int `json:"page"`
	PageTotal int `json:"page_total"`
	Total     int `json:"total"`
}

Jump to

Keyboard shortcuts

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