Documentation ¶
Index ¶
- type Category
- type CategoryAttributes
- type CategoryListResponse
- type CategoryResponse
- type Details
- type Flag
- type Flagger
- type Flags
- type Included
- func (c *Included) Add(includes ...Resource)
- func (c Included) MarshalJSON() ([]byte, error)
- func (c *Included) MustCategory(key Key) *Category
- func (c *Included) MustMeal(key Key) *Meal
- func (c *Included) MustMealMenu(key Key) *MealMenu
- func (c *Included) MustMenu(key Key) *Menu
- func (c *Included) MustReceipt(key Key) *Receipt
- func (c *Included) UnmarshalJSON(data []byte) error
- type Key
- type Links
- type Meal
- type MealAttributes
- type MealListResponse
- type MealMenu
- type MealMenuListResponse
- type MealMenuRelationships
- type MealMenuResponse
- type MealRelationships
- type MealResponse
- type Menu
- type MenuListResponse
- type MenuRelationships
- type MenuResponse
- type Receipt
- type ReceiptAttributes
- type ReceiptListResponse
- type ReceiptRelationships
- type ReceiptResponse
- type Relation
- type RelationCollection
- type Resource
- type ResourceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { Key Attributes CategoryAttributes `json:"attributes"` }
type CategoryAttributes ¶
type CategoryListResponse ¶
type CategoryResponse ¶
type Details ¶
type Details json.RawMessage
func (Details) MarshalJSON ¶
MarshalJSON - casts Details to []byte
func (*Details) UnmarshalJSON ¶
UnmarshalJSON - casts data to Details
type Included ¶
type Included struct {
// contains filtered or unexported fields
}
Included - an array of Resource objects that are related to the primary data and/or each other (“included resources”).
func (Included) MarshalJSON ¶
MarshalJSON - marshals include collection as array of json objects
func (*Included) MustCategory ¶
MustCategory - returns Category from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustMeal ¶
MustMeal - returns Meal from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustMealMenu ¶
MustMealMenu - returns MealMenu from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustMenu ¶
MustMenu - returns Menu from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustReceipt ¶
MustReceipt - returns Receipt from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) UnmarshalJSON ¶
UmarshalJSON - unmarshal array of json objects into include collection
type Key ¶
type Key struct { ID string `json:"id"` Type ResourceType `json:"type"` }
func NewKeyInt64 ¶
func NewKeyInt64(id int64, resourceType ResourceType) Key
func (Key) AsRelation ¶
type Meal ¶
type Meal struct { Key Attributes MealAttributes `json:"attributes"` Relationships MealRelationships `json:"relationships"` }
type MealAttributes ¶
type MealListResponse ¶
type MealMenu ¶
type MealMenu struct { Key Relationships MealMenuRelationships `json:"relationships"` }
type MealMenuListResponse ¶
type MealMenuRelationships ¶
type MealMenuResponse ¶
type MealRelationships ¶
type MealRelationships struct {
Category Relation `json:"category"`
}
type MealResponse ¶
type Menu ¶
type Menu struct { Key Relationships MenuRelationships `json:"relationships"` }
type MenuListResponse ¶
type MenuRelationships ¶
type MenuRelationships struct {
Cafe Relation `json:"cafe"`
}
type MenuResponse ¶
type Receipt ¶
type Receipt struct { Key Attributes ReceiptAttributes `json:"attributes"` Relationships ReceiptRelationships `json:"relationships"` }
type ReceiptAttributes ¶
type ReceiptAttributes struct {
Quantity int64 `json:"quantity"`
}
type ReceiptListResponse ¶
type ReceiptRelationships ¶
type ReceiptResponse ¶
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( CAFE_REF ResourceType = "cafe_ref" CATEGORY ResourceType = "category" INGREDIENT_REF ResourceType = "ingredient_ref" MEAL ResourceType = "meal" MEAL_MENU ResourceType = "meal_menu" MENU ResourceType = "menu" RECEIPT ResourceType = "receipt" )
List of ResourceType
Source Files ¶
- db.go
- flag.go
- included.go
- model_category.go
- model_category_attributes.go
- model_details.go
- model_key.go
- model_links.go
- model_meal.go
- model_meal_attributes.go
- model_meal_menu.go
- model_meal_menu_relationships.go
- model_meal_relationships.go
- model_menu.go
- model_menu_relationships.go
- model_receipt.go
- model_receipt_attributes.go
- model_receipt_relationships.go
- model_relation.go
- model_relation_collection.go
- model_resource_type.go