httpjson

package
v0.0.0-...-a42738c Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package httpjson contains helpers for working with http request / responses in json.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(rw http.ResponseWriter, status int, msg string, err error)

func Error

func Error(rw http.ResponseWriter, p ProblemDetail)

func Ok

func Ok(rw http.ResponseWriter, val any)

Types

type ProblemDetail

type ProblemDetail struct {
	Type     string         `json:"type,omitempty"`
	Title    string         `json:"title,omitempty"`
	Status   int            `json:"status,omitempty"`
	Detail   string         `json:"detail,omitempty"`
	Instance string         `json:"instance,omitempty"`
	Extra    map[string]any `json:",unknown"`
}

Jump to

Keyboard shortcuts

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