inventory

package
v0.0.0-...-a04e50b Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

inventory/inventory.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inventory

type Inventory struct {
	Products map[int]Product
}

Inventory represents the product inventory.

func NewInventory

func NewInventory() *Inventory

NewInventory creates a new inventory.

func (*Inventory) AddProduct

func (inv *Inventory) AddProduct(product Product)

AddProduct adds a product to the inventory.

type Product

type Product struct {
	ID    int
	Name  string
	Price float64
}

Product represents a product in the inventory.

Jump to

Keyboard shortcuts

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