grocy

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentStockResponse

type CurrentStockResponse struct {
	ProductID              string  `json:"product_id"`
	Amount                 string  `json:"amount"`
	AmountMissing          string  `json:"amount_missing,omitempty"`
	AmountAggregated       string  `json:"amount_aggregated"`
	AmountOpened           string  `json:"amount_opened"`
	AmountOpenedAggregated string  `json:"amount_opened_aggregated"`
	BestBeforeDate         string  `json:"best_before_date"`
	IsAggregatedAmount     string  `json:"is_aggregated_amount"`
	Product                Product `json:"product"`
	Name                   string  `json:"name,omitempty"`
}

type CurrentVolatileStockResponse

type CurrentVolatileStockResponse struct {
	DueProduct     []CurrentStockResponse `json:"due_products"`
	OverdueProduct []CurrentStockResponse `json:"overdue_products"`
	ExpiredProduct []CurrentStockResponse `json:"expired_products"`
	MissingProduct []CurrentStockResponse `json:"missing_products"`
}

type Grocy

type Grocy interface {
	GetDueProduct(days string) (SimpleProductData, error)
}

func NewClient

func NewClient(url string, apikey string) (Grocy, error)

type Product

type Product struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type SimpleProduct

type SimpleProduct struct {
	Name           string `json:"name"`
	BestBeforeDate string `json:"best_before_date,omitempty"`
	AmountMissing  string `json:"amount_missing,omitempty"`
}

type SimpleProductData

type SimpleProductData struct {
	DueProduct     []SimpleProduct `json:"due_products"`
	OverdueProduct []SimpleProduct `json:"overdue_products"`
	ExpiredProduct []SimpleProduct `json:"expired_products"`
	MissingProduct []SimpleProduct `json:"missing_products"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL