Documentation
¶
Index ¶
- func Stringify(v any) string
- type Attributes
- type CodeGetter
- type Errable
- type Error
- type ErrorResponse
- type Errors
- type Nil
- type Relationship
- type RelationshipHasMany
- type Relationships
- type Resource
- type ResourceIdentifier
- type Resourcer
- type Resourcers
- type Resources
- type Root
- type Serializer
- type Serializers
- type TitleGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attributes ¶ added in v0.0.3
type Attributes[T any] struct { // contains filtered or unexported fields }
func NewAttributes ¶ added in v0.0.3
func NewAttributes[T any](v T) Attributes[T]
func (Attributes[T]) JSONAPISerialize ¶ added in v0.0.3
func (a Attributes[T]) JSONAPISerialize() (string, error)
type CodeGetter ¶ added in v0.0.3
type CodeGetter interface {
Code() string
}
type Errable ¶ added in v0.0.3
func NewInternalServerError ¶ added in v0.0.3
type Error ¶
func NewBadRequest ¶ added in v0.0.3
func NewForbidden ¶ added in v0.0.3
func NewNotFound ¶ added in v0.0.3
func NewUnauthorized ¶ added in v0.0.3
func (Error) JSONAPISerialize ¶
type ErrorResponse ¶ added in v0.0.3
type ErrorResponse struct {
// contains filtered or unexported fields
}
func NewErrorResponse ¶ added in v0.0.3
func NewErrorResponse(err error) *ErrorResponse
func (ErrorResponse) Code ¶ added in v0.0.3
func (e ErrorResponse) Code() string
func (ErrorResponse) Error ¶ added in v0.0.3
func (e ErrorResponse) Error() string
func (ErrorResponse) Title ¶ added in v0.0.3
func (e ErrorResponse) Title() string
func (ErrorResponse) ToJSONAPIError ¶ added in v0.0.3
func (e ErrorResponse) ToJSONAPIError() Error
type Relationship ¶
type Relationship struct {
Data ResourceIdentifier
}
func (Relationship) JSONAPISerialize ¶
func (j Relationship) JSONAPISerialize() (string, error)
type RelationshipHasMany ¶
type RelationshipHasMany struct {
Data []ResourceIdentifier
}
func (RelationshipHasMany) JSONAPISerialize ¶
func (j RelationshipHasMany) JSONAPISerialize() (string, error)
type Relationships ¶
type Relationships map[string]Serializer
func (Relationships) JSONAPISerialize ¶
func (j Relationships) JSONAPISerialize() (string, error)
type Resource ¶
type Resource struct { ID string Type string Attributes Serializer Relationships Relationships }
func (Resource) JSONAPISerialize ¶
type ResourceIdentifier ¶
func (ResourceIdentifier) JSONAPISerialize ¶
func (j ResourceIdentifier) JSONAPISerialize() (string, error)
type Resourcers ¶ added in v0.0.4
type Resourcers []Resourcer
func (Resourcers) ToJSONAPIResource ¶ added in v0.0.4
func (r Resourcers) ToJSONAPIResource() (Resources, Resources)
type Resources ¶
type Resources struct { Data []Resource // contains filtered or unexported fields }
func (Resources) JSONAPISerialize ¶
type Root ¶
type Root[T Serializer] struct { Data T Errors Errors Meta Serializer Included Resources }
func NewManyFrom ¶
func NewManyFrom[T Resourcer](list []T, meta Serializer) (*Root[Resources], error)
type Serializer ¶
type Serializers ¶
type Serializers []Serializer
func (Serializers) JSONAPISerialize ¶
func (s Serializers) JSONAPISerialize() (string, error)
type TitleGetter ¶ added in v0.0.3
type TitleGetter interface {
Title() string
}
Click to show internal directories.
Click to hide internal directories.