import "github.com/leoride/go-hateoas"
create.go delete.go get_all.go get_one.go hateoas.go types.go update.go util.go
func Handle(apiPath string, rh ResourceHandler) error
type Error struct { Status int `json:"status"` Code int `json:"code"` Property string `json:"property,omitempty"` Message string `json:"message"` DeveloperMessage string `json:"developerMessage"` MoreInfo string `json:"moreInfo,omitempty"` }
This is a returned type Error type for REST hateoas
type Page struct { Href Url Offset int Limit int First *Url Previous *Url Next *Url Last *Url Items []hateoasResource TotalItems int }
This is a returned type Page type for REST hateoas
PageOpts type for page options extracted from the GET parameters
Abstract interface for a REST resource
type ResourceHandler interface { ResourceName() string GetOne(string) (Resource, *Error) GetAll(PageOpts) ([]Resource, *Error) Create(Resource) (string, *Error) Update(string, Resource) (Resource, *Error) Delete(string) *Error Count() (int, *Error) }
Abstract interface for a REST resource handler
URL type for representing HREF links
Package hateoas imports 6 packages (graph). Updated 2019-10-16. Refresh now. Tools for package owners.