Back to godoc.org
github.com/amonsat/gin-json-cr

Package gin_json_cr

v0.0.0-...-9b60c3b
Latest Go to latest

The highest tagged major version is .

Published: Dec 3, 2019 | License: MIT | Module: github.com/amonsat/gin-json-cr

Index

func IndentedJSON

func IndentedJSON(c *gin.Context, code int, obj interface{})

func JSON

func JSON(c *gin.Context, code int, obj interface{})

func WriteJSON

func WriteJSON(w http.ResponseWriter, obj interface{}) error

WriteJSON marshals the given interface object and writes it with custom ContentType.

type IndentedJsonRender

type IndentedJsonRender struct {
	Data interface{}
}

IndentedJSON contains the given interface object.

func (IndentedJsonRender) Render

func (r IndentedJsonRender) Render(w http.ResponseWriter) (err error)

Render writes data with custom ContentType.

func (IndentedJsonRender) WriteContentType

func (r IndentedJsonRender) WriteContentType(w http.ResponseWriter)

WriteContentType writes custom ContentType.

type JsonRender

type JsonRender struct {
	Data interface{}
}

func (JsonRender) Render

func (r JsonRender) Render(w http.ResponseWriter) (err error)

Render writes data with custom ContentType.

func (JsonRender) WriteContentType

func (r JsonRender) WriteContentType(w http.ResponseWriter)

WriteContentType writes custom ContentType.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier