Documentation ¶
Overview ¶
Package ginrest objetive is to have in one place ours rest operations, as standart rest IO with norm output Author: Rolando Lucio <rolando@compropago.com,rolandolucio@gmail.com>
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IO ¶
IO struct is the base app/json output formatter according to our defined schema
func (*IO) Res ¶
Res Rest Response According to proper type params: code proper httpStatusCode elements map of structs(interfaces) to append to the json output msg if want to override http default message for status code
if elements contains a key defined on response struct it will get overrided, in case code is override will not change the response code
The method will eval which http reference is set for the output like *gin.Context, if not found it will panic
References,inspirations : Eduardo Aguilar's Generator https://kev.inburke.com/kevin/golang-json-http/ http://attilaolah.eu/2014/09/10/json-and-struct-composition-in-go/ http://attilaolah.eu/2013/11/29/json-decoding-in-go/ http://eagain.net/articles/go-dynamic-json/ http://gregtrowbridge.com/golang-json-serialization-with-interfaces/