internal

package
v0.0.0-...-e108ed3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client *mongo.Client
View Source
var Collection *mongo.Collection

Assume you have a collection named "products"

Functions

func Create

func Create(product models.Product) (string, error)

Post function to create new product

func CreateProduct

func CreateProduct(product models.Product) (string, error)

Create function to add products

func Delete

func Delete(productID string) error

func DeleteProduct

func DeleteProduct(productID string) error

Delete function for products

func GetAll

func GetAll() ([]models.Product, error)

GetAll function to get all products

func GetAllProducts

func GetAllProducts() ([]models.Product, error)

Get function to get all products

func GetByID

func GetByID(id string) (models.Product, error)

Get function to get product by id

func GetByType

func GetByType(_type string) ([]models.Product, error)

Get function to get products by type

func GetProductByID

func GetProductByID(id string) (models.Product, error)

Get function to get product by id

func GetProductsWithType

func GetProductsWithType(_type string) ([]models.Product, error)

Get function to get all products that have the given type

func InitCollections

func InitCollections()

func InitMongoDB

func InitMongoDB(uri string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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