json

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeJSON

func EncodeJSON(w io.Writer, v any) error

A wrapper for json data encoding.

func ParseJSON

func ParseJSON[T any](r io.Reader) (T, error)

Same as func ParseJSONInto, but initziliazes new var of T.

func ParseJSONInto

func ParseJSONInto[T any](r io.Reader, target *T) error

Can be called when already having a var of type T. Unmarshals data into the target.

func WriteJSON

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

A func that can be used in handlers to write JSON. Includes status code and structured data to marshall.

Types

This section is empty.

Jump to

Keyboard shortcuts

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