json

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Built in parcel formatting for JSON

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

type Binder struct{}

Parcel binder for JSON

func (Binder) BindFromRequest

func (binder Binder) BindFromRequest(r *http.Request, target interface{}) error

Binds data from an HTTP request into a destination

func (Binder) BindFromResponse

func (binder Binder) BindFromResponse(r *http.Response, target interface{}) error

Binds data from an HTTP response into a destination

type Renderer

type Renderer struct{}

Parcel renderer for json data

func (Renderer) NewRequest

func (r Renderer) NewRequest(method string, url string, data interface{}) (*http.Request, error)

Creates a new HTTP request and renders data to the body of the request

func (Renderer) RenderErrorResponse

func (r Renderer) RenderErrorResponse(w http.ResponseWriter, err error)

func (Renderer) RenderResponse

func (r Renderer) RenderResponse(w http.ResponseWriter, status int, data interface{}) error

Renders data to an HTTP response writer

Jump to

Keyboard shortcuts

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