Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormatHandler ¶
type FormatHandler interface { Supports(format string) bool Handle(c *gin.Context, o interface{}) (interface{}, error) }
FormatHandler defines the behavior of a handler
type GeoJSONHandler ¶
type GeoJSONHandler struct{}
GeoJSONHandler is an struct implementing FormatHandler interface
func (GeoJSONHandler) Handle ¶
func (GeoJSONHandler) Handle(c *gin.Context, o interface{}) (interface{}, error)
Handle marshal the data (from FormatHandler interface)
func (GeoJSONHandler) Supports ¶
func (GeoJSONHandler) Supports(format string) bool
Supports defines which media type is supported (from FormatHandler interface)
type JSONAPIHandler ¶
type JSONAPIHandler struct{}
JSONAPIHandler is an struct implementing FormatHandler interface
func (JSONAPIHandler) Handle ¶
func (JSONAPIHandler) Handle(c *gin.Context, o interface{}) (interface{}, error)
Handle marshal the data (from FormatHandler interface)
func (JSONAPIHandler) Supports ¶
func (JSONAPIHandler) Supports(format string) bool
Supports defines which media type is supported (from FormatHandler interface)
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
Serializer is a registry of FormatHandler structs
func NewSerializer ¶
func NewSerializer(h ...FormatHandler) Serializer
NewSerializer is the factory of Serializer
Click to show internal directories.
Click to hide internal directories.