httpx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package httpx holds small HTTP helpers shared across the server and gateway — JSON responses in the api/v1 Error shape. No business logic lives here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteError

func WriteError(w http.ResponseWriter, status int, code, message string)

WriteError writes an error body matching the api/v1 Error schema ({code, message[, details]}).

func WriteErrorDetails

func WriteErrorDetails(w http.ResponseWriter, status int, code, message string, details any)

WriteErrorDetails is WriteError with an extra structured details object.

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, v any)

WriteJSON writes v as a JSON response with the given status code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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