Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteQuery ¶
type DeleteQuery struct { // ID int `form:"id"` TODO: https://github.com/gin-gonic/gin/pull/1061 IDs []int `form:"ids"` }
type IntSlice ¶
type IntSlice []int
IntSlice - a postgres compatible int slice type
func (*IntSlice) Scan ¶
sourced from https://gist.github.com/adharris/4163702
type JSONBMap ¶
type JSONBMap map[string]interface{}
TODO: consider using pgx intSlice TODO[ak|06/2018]: Scan() and Value() should work as is TODO[ak|06/2018]: I'm not sure about the text/binary related functions they are similar to pgtype.JSON and pgtype.JSONB Sourced from pgtype.JSON and pgype.JSONB
func (*JSONBMap) DecodeText ¶
type ListRequest ¶
type ListRequest struct { Limit int `json:"limit,omitempty" form:"limit,default=20" binding:"min=1,max=10000"` Offset int `json:"offset,omitempty" form:"offset,default=0" binding:"min=0"` Sort []string `json:"sort,omitempty" form:"sort" binding:""` Filter map[string]interface{} `json:"filter,omitempty" form:"filter"` }
type PagedResult ¶
type PagedResult struct { Records []interface{} `json:"records"` Page PagingInfo `json:"pagingInfo"` }
PagedResult - this is the model for all the list endpoints, each endpoint however has its own type that has typed records
type PagingInfo ¶
type PagingInfo struct { Offset int `json:"offset,omitempty" example:"1"` Limit int `json:"limit,omitempty" example:"1000"` // the page size TotalRecords int `json:"totalRecords,omitempty" example:"6530"` // the total amount of records Sort []string `json:"sort,omitempty" example:"id"` Filter map[string]interface{} `json:"filter,omitempty"` }
PagingInfo - this is used to describe the page in a list
func GetPageInfo ¶
func GetPageInfo(offset, limit, total int, sort []string, filter map[string]interface{}) PagingInfo
type StringSlice ¶
type StringSlice []string
StringSlice - a postgres compatible string slice type
func (*StringSlice) Scan ¶
func (s *StringSlice) Scan(src interface{}) error
sourced from https://gist.github.com/adharris/4163702
type WebError ¶
type WebError struct { Status int `json:"status,omitempty" example:"500"` // status code IncidentID string `json:"incidentId,omitempty" example:"89ed56f9-1935-4e13-9b3c-c208df64b484"` // trace reference id Message string `json:"message,omitempty" example:"Internal error"` // same as http status message Errors []string `json:"errors,omitempty" example:""` // list of actual errors "Field missing required length .. " MoreInfo string `json:"moreInfo,omitempty" example:""` // link to documentation if any }
WebError - This is a common error type used to standardize all api errors