Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AssertionFailure = fmt.Errorf("type assertion failed")
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection []Resource
type Document ¶
type Document struct { JSONAPI *Implementation `json:"jsonapi,omitempty"` Data interface{} `json:"data,omitempty"` Meta map[string]interface{} `json:"meta,omitempty"` Links LinksObject `json:"links,omitempty"` Included Included `json:"included,omitempty"` Errors []Error `json:"errors,omitempty"` }
func (*Document) AssertDataType ¶
func (*Document) ContentLength ¶
func (*Document) PopIncluded ¶
type Error ¶
type Error struct { Error error `json:"-"` Identifier string `json:"id,omitempty"` Links *LinksObject `json:"links,omitempty"` Status string `json:"status,omitempty"` Code string `json:"code,omitempty"` Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` Source *SourceObject `json:"source,omitempty"` Meta map[string]interface{} `json:"meta,omitempty"` }
type Implementation ¶
type Included ¶
type Included []Resource
func (Included) MergeResource ¶
Merge a resource into the collection, such as for `Included`
type LinksObject ¶
type LinksObject map[string]interface{}
type Resource ¶
type Resource struct { Identifier string `json:"id,omitempty"` Type string `json:"type"` Attributes map[string]interface{} `json:"attributes,omitempty"` Meta map[string]interface{} `json:"meta,omitempty"` Relationships map[string]Document `json:"relationships,omitempty"` // Links map[string]string `json:"links,omitempty"` Links LinksObject `json:"links,omitempty"` }
type SourceObject ¶
Click to show internal directories.
Click to hide internal directories.