Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseRepresentor ¶
type BaseRepresentor struct {
// contains filtered or unexported fields
}
BaseRepresentor is a basic template implementation of a Representor. It is basically a 'body' of a request or response.
This should not be used, refer to hal.go for the HalRepresentor as a good default option to use.
func New ¶
func New(u string, ct string, b string) *BaseRepresentor
New creates a new Representor object
type HALBody ¶
type HALBody struct { // TODO: This does not handle multiple "item" links. Need to handle // either a single HALLink or an array of HALLinks Links map[string][]HALLink `json:"_links,omitempty"` // This should be only JSON acceptable types: string, int, float, bool Properties map[string]interface{} `json:"-"` Embedded map[string]HALBody `json:"_embedded,omitempty"` }
func (HALBody) MarshalJSON ¶
MarshalJSON will properly convert a HALBody into JSON.
func (*HALBody) UnmarshalJSON ¶
UnmarshalJSON will properly convert JSON back into a HALBody object.
type HALRepresentor ¶
HALRepresentor is a basic template implementation of a Representor. It is basically a 'body' of a request or response.
This should not be used, refer to hal.go for the HalRepresentor as a good default option to use.
func NewHALRepresentor ¶
New creates a new Representor object.
type Representor ¶
type Representor interface { GetBody() interface{} GetLink(rt string) (*link.Link, error) GetLinks(rt string) []link.Link HasLink(rt string) bool // contains filtered or unexported methods }
Representor interface provides a way to handle many different types of acceptable representations.
func CreateFromResponse ¶
CreateFromResponse pulls the necessary information from the request and passes it on to the Create function.