Documentation
¶
Index ¶
- Constants
- func Marshal(v interface{}) ([]byte, error)
- func NewDecodeError(v interface{}, message string) error
- func NewEncodeError(v interface{}, message string) error
- func NewNotDecodableError(v interface{}) error
- func NewNotEncodableError(v interface{}) error
- func Unmarshal(data []byte, v interface{}) error
- type Decodable
- type DecodeAttributes
- type DecodeDocument
- type DecodeError
- type DecodePayload
- type DecodeRelationships
- type DecodeResourceLinkage
- type DecodeResourceObject
- type Encodable
- type EncodeAttributes
- type EncodeDocument
- type EncodeError
- type EncodeLinks
- type EncodeMeta
- type EncodePayload
- type EncodeRelationships
- type EncodeResourceLinkage
- type EncodeResourceLinkages
- type EncodeResourceObject
- type EncodeResourceObjects
- type Error
- type Errors
- type Link
- type Linkable
- type Meta
- type Metable
- type Relatable
- type Relationship
- type RelationshipDocument
- type RelationshipType
- type RelationshipsAssignable
- type Status
Constants ¶
View Source
const ContentType = "application/vnd.api+json"
Variables ¶
This section is empty.
Functions ¶
func NewDecodeError ¶
func NewEncodeError ¶
func NewNotDecodableError ¶
func NewNotDecodableError(v interface{}) error
func NewNotEncodableError ¶
func NewNotEncodableError(v interface{}) error
Types ¶
type DecodeAttributes ¶
type DecodeAttributes struct {
// contains filtered or unexported fields
}
func NewDecodeAttributes ¶
func NewDecodeAttributes(d Decodable) DecodeAttributes
func (DecodeAttributes) UnmarshalJSON ¶
func (da DecodeAttributes) UnmarshalJSON(data []byte) error
type DecodeDocument ¶
type DecodeDocument struct {
// contains filtered or unexported fields
}
func NewDecodeDocument ¶
func NewDecodeDocument(d Decodable) DecodeDocument
func (DecodeDocument) UnmarshalJSON ¶
func (dd DecodeDocument) UnmarshalJSON(data []byte) error
type DecodeError ¶
type DecodeError struct {
// contains filtered or unexported fields
}
func (DecodeError) Error ¶
func (e DecodeError) Error() string
type DecodePayload ¶
type DecodePayload struct {
// contains filtered or unexported fields
}
func NewDecodePayload ¶
func NewDecodePayload(v interface{}) DecodePayload
func (DecodePayload) UnmarshalJSON ¶
func (dp DecodePayload) UnmarshalJSON(data []byte) error
type DecodeRelationships ¶
type DecodeRelationships struct {
// contains filtered or unexported fields
}
func NewDecodeRelationships ¶
func NewDecodeRelationships(d Decodable) DecodeRelationships
func (DecodeRelationships) UnmarshalJSON ¶
func (dr DecodeRelationships) UnmarshalJSON(data []byte) error
type DecodeResourceLinkage ¶
func (DecodeResourceLinkage) Primary ¶
func (drl DecodeResourceLinkage) Primary() string
func (DecodeResourceLinkage) Type ¶
func (drl DecodeResourceLinkage) Type() string
type DecodeResourceObject ¶
type DecodeResourceObject struct {
// contains filtered or unexported fields
}
func NewDecodeResourceObject ¶
func NewDecodeResourceObject(d Decodable) DecodeResourceObject
func (DecodeResourceObject) UnmarshalJSON ¶
func (dro DecodeResourceObject) UnmarshalJSON(data []byte) error
type Encodable ¶
func ToEncodable ¶
type EncodeAttributes ¶
type EncodeAttributes map[string]interface{}
func NewEncodeAttributes ¶
func NewEncodeAttributes(m interface{}) EncodeAttributes
type EncodeDocument ¶
type EncodeDocument struct {
Data json.Marshaler `json:"data,omitempty"`
Errors Errors `json:"errors,omitempty"`
}
func NewErrorsEncodeDocument ¶
func NewErrorsEncodeDocument(errors Errors) (EncodeDocument, error)
func NewMultipleEncodeDocument ¶
func NewMultipleEncodeDocument(m interface{}) (EncodeDocument, error)
func NewSingularEncodeDocument ¶
func NewSingularEncodeDocument(m interface{}) (EncodeDocument, error)
type EncodeError ¶
type EncodeError struct {
// contains filtered or unexported fields
}
func (EncodeError) Error ¶
func (e EncodeError) Error() string
type EncodeLinks ¶
func NewEncodeLinks ¶
func NewEncodeLinks(m interface{}) EncodeLinks
type EncodeMeta ¶ added in v0.2.0
type EncodeMeta map[string]interface{}
func NewEncodeMeta ¶ added in v0.2.0
func NewEncodeMeta(m interface{}) EncodeMeta
type EncodePayload ¶
type EncodePayload struct {
// contains filtered or unexported fields
}
func NewEncodePayload ¶
func NewEncodePayload(m interface{}) EncodePayload
func (EncodePayload) MarshalJSON ¶
func (ep EncodePayload) MarshalJSON() ([]byte, error)
type EncodeRelationships ¶
type EncodeRelationships map[string]RelationshipDocument
func NewEncodeRelationships ¶
func NewEncodeRelationships(m interface{}) EncodeRelationships
type EncodeResourceLinkage ¶
func NewEncodeResourceLinkage ¶
func NewEncodeResourceLinkage(e Encodable) EncodeResourceLinkage
func (EncodeResourceLinkage) MarshalJSON ¶
func (erl EncodeResourceLinkage) MarshalJSON() ([]byte, error)
type EncodeResourceLinkages ¶
type EncodeResourceLinkages []EncodeResourceLinkage
func (EncodeResourceLinkages) MarshalJSON ¶
func (erl EncodeResourceLinkages) MarshalJSON() ([]byte, error)
type EncodeResourceObject ¶
type EncodeResourceObject struct {
Type string
ID string
Attributes EncodeAttributes
Links EncodeLinks
Relationships EncodeRelationships
Meta EncodeMeta
}
func NewEncodeResourceObject ¶
func NewEncodeResourceObject(encodable Encodable) EncodeResourceObject
func (EncodeResourceObject) MarshalJSON ¶
func (ero EncodeResourceObject) MarshalJSON() ([]byte, error)
type EncodeResourceObjects ¶
type EncodeResourceObjects []EncodeResourceObject
func (EncodeResourceObjects) MarshalJSON ¶
func (ero EncodeResourceObjects) MarshalJSON() ([]byte, error)
type Relatable ¶
type Relatable interface {
Relationships() []Relationship
}
type Relationship ¶
type Relationship struct {
Name string
Type RelationshipType
Resource Encodable
}
type RelationshipDocument ¶
type RelationshipType ¶
type RelationshipType int
const ( Unknown RelationshipType = iota SingularRelationship MultiRelationship )
type RelationshipsAssignable ¶
type RelationshipsAssignable interface {
AssignRelationships([]Relationship)
}
Source Files
¶
- constants.go
- decodable.go
- decode_attributes.go
- decode_document.go
- decode_errors.go
- decode_payload.go
- decode_relationships.go
- decode_resource_linkage.go
- decode_resource_object.go
- encodable.go
- encode_attributes.go
- encode_document.go
- encode_errors.go
- encode_links.go
- encode_meta.go
- encode_payload.go
- encode_relationships.go
- encode_resource_linkage.go
- encode_resource_object.go
- errors.go
- link.go
- marshal.go
- meta.go
- relationship.go
- unmarshal.go
Click to show internal directories.
Click to hide internal directories.