jsonutil

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package jsonutil provides common utilities for properly handling JSON payloads in HTTP body.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalResponse added in v0.19.0

func MarshalResponse(w http.ResponseWriter, status int, response interface{})

MarshalResponse is a helper function to write an object to the http.ResponseWriter with fallback error template.

func Unmarshal

func Unmarshal(w http.ResponseWriter, r *http.Request, data interface{}) (int, error)

Unmarshal provides a common implementation of JSON unmarshalling with well defined error handling.

Types

This section is empty.

Jump to

Keyboard shortcuts

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