hal

package
v0.0.0-...-83625b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHALLinkList(linkmap map[string][]interface{}, curies []HALCurie) map[string]interface{}

Types

type EndpointLinker

type EndpointLinker interface {
	Links() map[string][]interface{}
	Curies() []HALCurie
}

EndpointLinker adds links and curies to an endpoint.

If an entity implements this, HAL data will be added to the response with the HALJSON Render type.

type HALCurie

type HALCurie struct {
	Name      string `json:"name"`
	Href      string `json:"href"`
	Templated bool   `json:"templated"`
}

HALCurie contains documentation information for the endpoint.

type HalLink struct {
	Href string `json:"href"`
}

type HalWrapper

type HalWrapper struct {
	Item  interface{}            `json:"item"`
	Links map[string]interface{} `json:"_links"`
}

func NewHalWrapper

func NewHalWrapper(el EndpointLinker) HalWrapper

func (HalWrapper) MarshalJSON

func (w HalWrapper) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL