jsonapi/node.go

35 lines
988 B
Go
Raw Normal View History

package jsonapi
2015-07-07 12:52:38 -04:00
type JsonApiOnePayload struct {
Data *JsonApiNode `json:"data"`
Included []*JsonApiNode `json:"included,omitempty"`
Links *map[string]string `json:"links,omitempty"`
}
2015-07-07 12:52:38 -04:00
type JsonApiManyPayload struct {
Data []*JsonApiNode `json:"data"`
Included []*JsonApiNode `json:"included,omitempty"`
Links *map[string]string `json:"links,omitempty"`
}
type Models interface {
GetData() []interface{}
}
type JsonApiNode struct {
Type string `json:"type"`
Id string `json:"id"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
Relationships map[string]interface{} `json:"relationships,omitempty"`
}
2015-07-07 12:52:38 -04:00
type JsonApiRelationshipOneNode struct {
Data *JsonApiNode `json:"data"`
Links *map[string]string `json:"links,omitempty"`
}
2015-07-07 12:52:38 -04:00
type JsonApiRelationshipManyNode struct {
Data []*JsonApiNode `json:"data"`
Links *map[string]string `json:"links,omitempty"`
}