Documentation
¶
Index ¶
- type Address
- type AddressAttributes
- type AddressListResponse
- type AddressResponse
- type Delivery
- type DeliveryAttributes
- type DeliveryListResponse
- type DeliveryRelationships
- type DeliveryResponse
- 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) MustAddress(key Key) *Address
- func (c *Included) MustDelivery(key Key) *Delivery
- func (c *Included) MustIngredient(key Key) *Ingredient
- func (c *Included) MustUsedIngredient(key Key) *UsedIngredient
- func (c *Included) MustWarehouse(key Key) *Warehouse
- func (c *Included) MustWarehouseIngredient(key Key) *WarehouseIngredient
- func (c *Included) UnmarshalJSON(data []byte) error
- type Ingredient
- type IngredientAttributes
- type IngredientListResponse
- type IngredientResponse
- type Key
- type Links
- type Relation
- type RelationCollection
- type Resource
- type ResourceType
- type UsedIngredient
- type UsedIngredientAttributes
- type UsedIngredientListResponse
- type UsedIngredientResponse
- type Warehouse
- type WarehouseAttributes
- type WarehouseIngredient
- type WarehouseIngredientAttributes
- type WarehouseIngredientListResponse
- type WarehouseIngredientRelationships
- type WarehouseIngredientResponse
- type WarehouseListResponse
- type WarehouseRelationships
- type WarehouseResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
Key
Attributes AddressAttributes `json:"attributes"`
}
type AddressAttributes ¶
type AddressListResponse ¶
type AddressResponse ¶
type Delivery ¶
type Delivery struct {
Key
Attributes DeliveryAttributes `json:"attributes"`
Relationships DeliveryRelationships `json:"relationships"`
}
type DeliveryAttributes ¶
type DeliveryListResponse ¶
type DeliveryRelationships ¶
type DeliveryResponse ¶
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) MustAddress ¶
MustAddress - returns Address 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) MustDelivery ¶
MustDelivery - returns Delivery 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) MustIngredient ¶
func (c *Included) MustIngredient(key Key) *Ingredient
MustIngredient - returns Ingredient 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) MustUsedIngredient ¶
func (c *Included) MustUsedIngredient(key Key) *UsedIngredient
MustUsedIngredient - returns UsedIngredient 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) MustWarehouse ¶
MustWarehouse - returns Warehouse 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) MustWarehouseIngredient ¶
func (c *Included) MustWarehouseIngredient(key Key) *WarehouseIngredient
MustWarehouseIngredient - returns WarehouseIngredient 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 Ingredient ¶
type Ingredient struct {
Key
Attributes IngredientAttributes `json:"attributes"`
}
type IngredientAttributes ¶
type IngredientAttributes struct {
Name string `json:"name"`
}
type IngredientListResponse ¶
type IngredientListResponse struct {
Data []Ingredient `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
}
type IngredientResponse ¶
type IngredientResponse struct {
Data Ingredient `json:"data"`
Included Included `json:"included"`
}
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 RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( ADDRESS ResourceType = "address" DELIVERY ResourceType = "delivery" INGREDIENT ResourceType = "ingredient" USED_INGREDIENT ResourceType = "used_ingredient" WAREHOUSE_INGREDIENT ResourceType = "warehouse_ingredient" WAREHOUSE ResourceType = "warehouse" )
List of ResourceType
type UsedIngredient ¶
type UsedIngredient struct {
Key
Attributes UsedIngredientAttributes `json:"attributes"`
}
type UsedIngredientListResponse ¶
type UsedIngredientListResponse struct {
Data []UsedIngredient `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
}
type UsedIngredientResponse ¶
type UsedIngredientResponse struct {
Data UsedIngredient `json:"data"`
Included Included `json:"included"`
}
type Warehouse ¶
type Warehouse struct {
Key
Attributes WarehouseAttributes `json:"attributes"`
Relationships WarehouseRelationships `json:"relationships"`
}
type WarehouseAttributes ¶
type WarehouseIngredient ¶
type WarehouseIngredient struct {
Key
Attributes WarehouseIngredientAttributes `json:"attributes"`
Relationships WarehouseIngredientRelationships `json:"relationships"`
}
type WarehouseIngredientListResponse ¶
type WarehouseIngredientListResponse struct {
Data []WarehouseIngredient `json:"data"`
Included Included `json:"included"`
Links *Links `json:"links"`
}
type WarehouseIngredientResponse ¶
type WarehouseIngredientResponse struct {
Data WarehouseIngredient `json:"data"`
Included Included `json:"included"`
}
type WarehouseListResponse ¶
type WarehouseRelationships ¶
type WarehouseRelationships struct {
Address Relation `json:"address"`
}
type WarehouseResponse ¶
Source Files
¶
- db.go
- flag.go
- included.go
- model_address.go
- model_address_attributes.go
- model_delivery.go
- model_delivery_attributes.go
- model_delivery_relationships.go
- model_details.go
- model_ingredient.go
- model_ingredient_attributes.go
- model_key.go
- model_links.go
- model_relation.go
- model_relation_collection.go
- model_resource_type.go
- model_used_ingredient.go
- model_used_ingredient_attributes.go
- model_warehouse.go
- model_warehouse_attributes.go
- model_warehouse_ingredient.go
- model_warehouse_ingredient_attributes.go
- model_warehouse_ingredient_relationships.go
- model_warehouse_relationships.go