Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiProblem ¶
type ApiProblem struct { DescribedBy string `json:"describedBy"` // a URL to a document describing the error condition (required) Title string `json:"title"` // a brief title for the error condition (required) HttpStatus int `json:"httpStatus,omitempty"` // the HTTP status code for the current request (optional) Details string `json:"details,omitempty"` // error details specific to this request (optional) SupportID string `json:"supportId,omitempty"` // a URL to the specific problem occurrence (e.g., to a log message) (optional) }
ApiProblem describes an API error according to the API-Problem proposed standard. https://phlyrestfully.readthedocs.io/en/latest/problems.html https://datatracker.ietf.org/doc/html/draft-nottingham-http-problem-02
func NewApiProblem ¶
func NewApiProblem(statusCode int, err error) ApiProblem
type Collection ¶
type Collection[T any] struct { *query.Pagination *ResourceEmbeds[T] *ResourceLinks }
Collection represents a paginated list of API content. https://phlyrestfully.readthedocs.io/en/latest/halprimer.html#collections
func NewCollection ¶
type Message ¶
func NewMessage ¶
type Resource ¶
type Resource struct { *ResourceEmbeds[any] *ResourceLinks }
Resource represents an individual piece of content exposed by the API. https://phlyrestfully.readthedocs.io/en/latest/halprimer.html#resources
func NewResource ¶
type ResourceEmbeds ¶
type ResourceEmbeds[T any] struct { Embeds T `json:"_embedded,omitempty" gorm:"embedded"` }
func NewEmbeds ¶
func NewEmbeds[T any](embeds T) *ResourceEmbeds[T]
type ResourceLinks ¶
type ResourceLinks struct {
Links `json:"_links,omitempty" gorm:"-"`
}
func NewCollectionLinks ¶
func NewCollectionLinks(q query.Builder, linkUrl *url.URL) *ResourceLinks
func NewLinks ¶
func NewLinks() *ResourceLinks
func NewResourceLinks ¶
func NewResourceLinks(selfHref string) *ResourceLinks
func (*ResourceLinks) AddLink ¶
func (l *ResourceLinks) AddLink(key string, link Link) *ResourceLinks
Click to show internal directories.
Click to hide internal directories.