Documentation
¶
Index ¶
Constants ¶
View Source
const ( CategoryConcentrates = "Concentrates" CategoryVapes = "Vapes" CategoryFlower = "Flower" )
Valid values for Category
View Source
const ( SubCategoryConcentratesOil = "Oil" SubCategoryConcentratesWax = "Wax" SubCategoryConcentratesShatter = "Shatter" SubCategoryVapesApex = "Apex" SubCategoryVapesRubi = "Rubi" SubCategoryVapesRempen = "Rempen" )
Valid values for SubCategory
View Source
const ( FilterIndica = "Indica" FilterSativa = "Sativa" FilterHybrid = "Hybrid" )
Valid values for Filter
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides access to the NETA reserve-ahead API
func (*Client) Query ¶
func (c *Client) Query() *QueryBuilder
Query returns a builder for a new query against the API
type LabTest ¶
type LabTest struct {
Name string `json:"lab_test_name"`
Value float64 `json:"lab_test_value"`
Unit string `json:"lab_test_unit"`
}
LabTest is a cannabinoid measurement for the Product
type Price ¶
type Price struct {
UnitID int `json:"product_unit_id"`
Quantity int `json:"quantity"`
RawPrice interface{} `json:"price"`
Price float64 `json:"-"`
TopLine string `json:"top_line"`
BottomLine string `json:"bottom_line"`
}
Price contains various representations of the price of the Product
type Product ¶
type Product struct {
ID int `json:"id"`
Name string `json:"name"`
Category string `json:"type_name"`
SubCategory string `json:"category"`
Type string `json:"type"`
LabTests []LabTest `json:"lab_tests"`
Description string `json:"description"`
Prices []Price `json:"prices"`
}
Product is a cannabis product available to reserve ahead
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
QueryBuilder exposes methods for building a query against the API
func (*QueryBuilder) Category ¶
func (qb *QueryBuilder) Category(category string) *QueryBuilder
Category sets a category for the query
func (*QueryBuilder) Do ¶
func (qb *QueryBuilder) Do() ([]Product, error)
Do executes the query and returns the result as a slice of Products
func (*QueryBuilder) Filter ¶
func (qb *QueryBuilder) Filter(filter string) *QueryBuilder
Filter sets a filter for the query
func (*QueryBuilder) SubCategory ¶
func (qb *QueryBuilder) SubCategory(subCategory string) *QueryBuilder
SubCategory sets a sub-cateogry for the query
Click to show internal directories.
Click to hide internal directories.