forked from Mirrors/jsonapi
35 lines
953 B
Go
35 lines
953 B
Go
package jsonapi
|
|
|
|
type OnePayload struct {
|
|
Data *Node `json:"data"`
|
|
Included []*Node `json:"included,omitempty"`
|
|
Links *map[string]string `json:"links,omitempty"`
|
|
}
|
|
|
|
type ManyPayload struct {
|
|
Data []*Node `json:"data"`
|
|
Included []*Node `json:"included,omitempty"`
|
|
Links *map[string]string `json:"links,omitempty"`
|
|
}
|
|
|
|
type Models interface {
|
|
GetData() []interface{}
|
|
}
|
|
|
|
type Node struct {
|
|
Type string `json:"type"`
|
|
Id string `json:"id"`
|
|
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
|
Relationships map[string]interface{} `json:"relationships,omitempty"`
|
|
}
|
|
|
|
type RelationshipOneNode struct {
|
|
Data *Node `json:"data"`
|
|
Links *map[string]string `json:"links,omitempty"`
|
|
}
|
|
|
|
type RelationshipManyNode struct {
|
|
Data []*Node `json:"data"`
|
|
Links *map[string]string `json:"links,omitempty"`
|
|
}
|