rest

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LinkSelf     = "self"
	LinkFirst    = "first"
	LinkLast     = "last"
	LinkPrevious = "previous"
	LinkNext     = "next"

	// QueryPage is query param use for the pagination
	QueryPage = "_page"
)

List of available links for collection

Variables

This section is empty.

Functions

func GenerateURI

func GenerateURI(ctx *aah.Context, routeName string, args ...interface{}) string

GenerateURI return uri for one given route

Types

type Embedded

type Embedded map[string]interface{}

Embedded struct in hateoas response

type Hateoas

type Hateoas struct {
	Embedded Embedded `json:"_embedded,omitempty" gorm:"-"`
	Links    Links    `json:"_links,omitempty"    gorm:"-"`
}

Hateoas struct with all necessary component for hateoas response

type Hateoasable

type Hateoasable interface {
	GenerateHateoas(ctx *aah.Context) error
}

Hateoasable interface for generate hateoas content

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

Link to another resource

type Links map[string]Link

Links to another resources

Jump to

Keyboard shortcuts

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