Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handle ¶
func Handle(apiPath string, rh ResourceHandler) error
Types ¶
type 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 ¶
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
type ResourceHandler ¶
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
Click to show internal directories.
Click to hide internal directories.