api

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

File: helpers.go source: https://www.alexedwards.net/blog/how-to-properly-parse-a-json-request-body

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	HDB *hdb.HomeDB
}

func (*API) InitializeEndpoints

func (a *API) InitializeEndpoints(router *mux.Router)

type AddInventoryRequest

type AddInventoryRequest struct {
	ProductId  int `json:"product_id"`
	LocationId int `json:"location_id"`
	Amount     int `json:"amount"`
}

type CreateProductCategories

type CreateProductCategories struct {
	CategoryName string `json:"category_name"`
}

type UpdateInventoryRequest

type UpdateInventoryRequest struct {
	LocationId    int  `json:"location_id"`
	NewAmount     *int `json:"new_amount,omitempty"`
	NewLocationId *int `json:"new_location_id,omitempty"`
}

type UpdateProductCategoryRequest

type UpdateProductCategoryRequest struct {
	CategoryName string `json:"category_name"`
}

type UpdateProductRequest

type UpdateProductRequest struct {
	ProductName        *string `json:"product_name,omitempty"`
	ProductDescription *string `json:"product_description,omitempty"`
	ProductCategory    *int    `json:"product_category,omitempty"`
}

Jump to

Keyboard shortcuts

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