Versions in this module Expand all Collapse all v0 v0.2.0 May 19, 2026 Changes in this version + const ISO8601TimeFormat + const KeyFirstPage + const KeyLastPage + const KeyNextPage + const KeyPreviousPage + const KeySelfLink + 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 ErrInvalidDateFormat = errors.New("Only strings can be parsed as dates, format: YYYY-MM-DD") + 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 ErrInvalidTimeFormat = errors.New("Only strings can be parsed as times, format: HH:MM:SS") + var ErrInvalidType = errors.New("Invalid type provided") + var ErrTypeNotFound = errors.New("no primary type annotation found on model") + var ErrUnexpectedNil = errors.New("slice of struct pointers cannot contain nil") + 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 MarshalManyPayloads[T any](w io.Writer, models ListResponse[T], opts ...MarshalOption) error + func MarshalOnePayloadEmbedded(w io.Writer, model interface{}) error + func MarshalPayload[T any](w io.Writer, models T, opts ...MarshalOption) error + type ErrUnsupportedPtrType struct + func (eupt ErrUnsupportedPtrType) Error() string + type ErrorObject struct + Code string + Detail string + ID string + Meta *map[string]interface{} + Source *ErrorSource + Status string + Title string + func UnmarshalErrors(reader io.Reader) ([]*ErrorObject, error) + func (e *ErrorObject) Error() string + type ErrorSource struct + Header string + Parameter string + Pointer string + type ErrorsPayload struct + Errors []*ErrorObject + Spec *Spec + type Link struct + Href string + Meta Meta + type Linkable interface + JSONAPILinks func() *Links + type Links map[string]interface + type ListResponse interface + Results func() []T + type ManyPayload struct + Data []*Node + Included []*Node + Links *Links + Meta *Meta + Spec *Spec + type MarshalHook interface + BeforeMarshal func() error + type MarshalOption func(*MarshalOptions) + func WithInclude(relations ...string) MarshalOption + type MarshalOptions struct + IncludeRelations []string + 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 NullableAttr map[bool]T + func NewNullNullableAttr[T any]() NullableAttr[T] + func NewNullableAttrWithValue[T any](t T) NullableAttr[T] + func (t *NullableAttr[T]) Set(value T) + func (t *NullableAttr[T]) SetInterface(value interface{}) + func (t *NullableAttr[T]) SetNull() + func (t *NullableAttr[T]) SetUnspecified() + func (t NullableAttr[T]) Get() (T, error) + func (t NullableAttr[T]) IsNull() bool + func (t NullableAttr[T]) IsSpecified() bool + type NullableRelationship map[bool]T + func NewNullNullableRelationship[T any]() NullableRelationship[T] + func NewNullableRelationshipWithValue[T any](t T) NullableRelationship[T] + func (t *NullableRelationship[T]) Set(value T) + func (t *NullableRelationship[T]) SetInterface(value interface{}) + func (t *NullableRelationship[T]) SetNull() + func (t *NullableRelationship[T]) SetUnspecified() + func (t NullableRelationship[T]) Get() (T, error) + func (t NullableRelationship[T]) IsNull() bool + func (t NullableRelationship[T]) IsSpecified() bool + type OnePayload struct + Data *Node + Included []*Node + Links *Links + Meta *Meta + Spec *Spec + type Payloader interface + func MarshalMany[T any](models ListResponse[T], opts ...MarshalOption) (Payloader, error) + func Marshal[T any](model T, opts ...MarshalOption) (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 Spec struct + Extensions []string + Metadata Meta + Profiles []string + Version string + type UnmarshalHook interface + AfterUnmarshal func() error + type UnmarshalResult struct + Data T + Meta any + func UnmarshalManyPayload[T any](in io.Reader) (*UnmarshalResult[[]T], error) + func UnmarshalPayload[T any](in io.Reader) (*UnmarshalResult[T], error)