Versions in this module Expand all Collapse all v1 v1.1.2 May 11, 2023 Changes in this version + const KeyFirstPage + const KeyLastPage + const KeyNextPage + const KeyPreviousPage + const MediaType + const QueryParamPageCursor + const QueryParamPageLimit + const QueryParamPageNumber + const QueryParamPageOffset + const QueryParamPageSize + var ErrBadJSONAPIID = errors.New("id should be either string, int(8,16,32,64) or uint(8,16,32,64)") + var ErrBadJSONAPIStructTag = errors.New("Bad jsonapi struct tag format") + var ErrExpectedSlice = errors.New("models should be a slice of struct pointers") + var ErrInvalidISO8601 = errors.New("Only strings can be parsed as dates, ISO8601 timestamps") + var ErrInvalidRFC3339 = errors.New("Only strings can be parsed as dates, RFC3339 timestamps") + var ErrInvalidTime = errors.New("Only numbers can be parsed as dates, unix timestamps") + var ErrInvalidType = errors.New("Invalid type provided") + var ErrUnexpectedType = errors.New("models should be a struct pointer or slice of struct pointers") + var ErrUnknownFieldNumberType = errors.New("The struct field was not of a known number type") + func MarshalErrors(w io.Writer, errorObjects []*ErrorObject) error + func MarshalOnePayloadEmbedded(w io.Writer, model interface{}) error + func MarshalPayload(w io.Writer, models interface{}) error + func MarshalPayloadWithoutIncluded(w io.Writer, model interface{}) error + func UnmarshalManyPayload(in io.Reader, t reflect.Type) ([]interface{}, error) + func UnmarshalPayload(in io.Reader, model interface{}) error + type ErrUnsupportedPtrType struct + func (eupt ErrUnsupportedPtrType) Error() string + type ErrorObject struct + Code string + Detail string + ID string + Meta *map[string]interface{} + Status string + Title string + func (e *ErrorObject) Error() string + type ErrorsPayload struct + Errors []*ErrorObject + type Event int + const MarshalStart + const MarshalStop + const UnmarshalStart + const UnmarshalStop + type Events func(*Runtime, Event, string, time.Duration) + var Instrumentation Events + type Link struct + Href string + Meta Meta + type Linkable interface + JSONAPILinks func() *Links + type Links map[string]interface + type ManyPayload struct + Data []*Node + Included []*Node + Links *Links + Meta *Meta + type Meta map[string]interface + type Metable interface + JSONAPIMeta func() *Meta + type Node struct + Attributes map[string]interface{} + ClientID string + ID string + Links *Links + Meta *Meta + Relationships map[string]interface{} + Type string + type OnePayload struct + Data *Node + Included []*Node + Links *Links + Meta *Meta + type Payloader interface + func Marshal(models interface{}) (Payloader, error) + type RelationshipLinkable interface + JSONAPIRelationshipLinks func(relation string) *Links + type RelationshipManyNode struct + Data []*Node + Links *Links + Meta *Meta + type RelationshipMetable interface + JSONAPIRelationshipMeta func(relation string) *Meta + type RelationshipOneNode struct + Data *Node + Links *Links + Meta *Meta + type Runtime struct + func NewRuntime() *Runtime + func (r *Runtime) Instrument(key string) *Runtime + func (r *Runtime) MarshalPayload(w io.Writer, model interface{}) error + func (r *Runtime) UnmarshalManyPayload(reader io.Reader, kind reflect.Type) (elems []interface{}, err error) + func (r *Runtime) UnmarshalPayload(reader io.Reader, model interface{}) error + func (r *Runtime) Value(key string) interface{} + func (r *Runtime) WithValue(key string, value interface{}) *Runtime