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

    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.