Documentation ¶
Overview ¶
Package jsonhal provides structs and methods to easily wrap your own data in a HAL compatible struct with support for hyperlinks and embedded resources HAL specification: http://stateless.co/hal_specification.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmbedGetter ¶
EmbedSetter is the interface that wraps the basic setEmbedded method.
GetEmbedded returns a slice of embedded resources by name or error
type EmbedSetter ¶
EmbedSetter is the interface that wraps the basic setEmbedded method.
SetEmbedded adds a slice of objects under a named key in the embedded map
type Embedder ¶
type Embedder interface { EmbedSetter EmbedGetter }
Embeddeer is the interface that wraps the basic setEmbedded and getEmbedded methods.
type Hal ¶
type Hal struct { Links map[string]*Link `json:"_links,omitempty"` Embedded map[string]Embedded `json:"_embedded,omitempty"` }
Hal is used for composition, include it as anonymous field in your structs
func (*Hal) DeleteEmbedded ¶
DeleteEmbedded removes an embedded resource named name if it is found
func (*Hal) DeleteLink ¶
DeleteLink removes a link named name if it is found
func (*Hal) GetEmbedded ¶
GetEmbedded returns a slice of embedded resources by name or error
func (*Hal) SetEmbedded ¶
SetEmbedded adds a slice of objects under a named key in the embedded map