Documentation ¶
Index ¶
- func ListenAndServe(port int, projectID, secret string, cacheEnabled bool)
- func RestEntryHandler(w http.ResponseWriter, r *http.Request, config RestConfig)
- func RestGetAllTeasHandler(w http.ResponseWriter, r *http.Request, config RestConfig)
- func RestTeaHandler(w http.ResponseWriter, r *http.Request, config RestConfig)
- type Cache
- type GcpClient
- func (c *GcpClient) AllTeas() (teas []Tea, err error)
- func (c *GcpClient) CreateEntry(id int, entry TeaEntry) error
- func (c *GcpClient) CreateTea(tea Tea) error
- func (c *GcpClient) DeleteTea(teaID int) error
- func (c *GcpClient) TeaByID(id int) (t Tea, err error)
- func (c *GcpClient) UpdateEntry(id int, entry TeaEntry) error
- func (c *GcpClient) UpdateTea(tea Tea) error
- type RestConfig
- type Tea
- type TeaEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
func RestEntryHandler ¶
func RestEntryHandler(w http.ResponseWriter, r *http.Request, config RestConfig)
func RestGetAllTeasHandler ¶
func RestGetAllTeasHandler(w http.ResponseWriter, r *http.Request, config RestConfig)
func RestTeaHandler ¶
func RestTeaHandler(w http.ResponseWriter, r *http.Request, config RestConfig)
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a cache struct
type GcpClient ¶
type GcpClient struct {
// contains filtered or unexported fields
}
GcpClient is the client struct
func (*GcpClient) CreateEntry ¶
CreateEntry creates a new entry on an existing tea
func (*GcpClient) UpdateEntry ¶
UpdateEntry updates an existing entry
type RestConfig ¶
type Tea ¶
type Tea struct { ID int `json:"id"` Name string `json:"name"` Timestamp string `json:"timestamp"` // TODO Date *time.Time `json:"date"` // TODO Type string `json:"type"` Region string `json:"region"` Year int `json:"year"` Flush string `json:"flush"` Purchaselocation string `json:"purchaselocation"` Purchasedate *time.Time `json:"purchasedate"` Purchaseprice float32 `json:"purchaseprice"` Comments string `json:"comments"` Pictures []string `json:"pictures"` Country string `json:"country"` Leafgrade string `json:"leafgrade"` Blendedteas string `json:"blendedteas"` Blendratio string `json:"blendratio"` Size int `json:"size"` Stocked bool `json:"stocked"` Aging bool `json:"aging"` Packaging string `json:"packaging"` Sample bool `json:"sample"` Entries []TeaEntry `json:"entries"` Progenitor int `json:"progenitor"` }
Tea encapsulates a specific tea and its journal entries
type TeaEntry ¶
type TeaEntry struct { Comments string `json:"comments"` Timestamp string `json:"timestamp"` Datetime *time.Time `json:"datetime"` Rating int `json:"rating"` Pictures []string `json:"pictures"` Steeptime int `json:"steeptime"` SteepingvesselIdx int `json:"steepingvessel_idx"` Steeptemperature int `json:"steeptemperature"` // TODO: in F Sessioninstance string `json:"sessioninstance"` Sessionclosed bool `json:"sessionclosed"` Fixins []string `json:"fixins"` }
TeaEntry encapsulates the data needed for a journal entry
Click to show internal directories.
Click to hide internal directories.