product

package
v0.0.0-...-ed7ba4f Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package product : Product service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler : Product handler

func NewHandler

func NewHandler(store types.ProductStore) *Handler

NewHandler creates a new product handler

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(router *mux.Router)

RegisterRoutes registers product routes

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store : Product store

func NewStore

func NewStore(db *sql.DB) *Store

NewStore : Create a new product store

func (*Store) GetProducts

func (s *Store) GetProducts() ([]types.Product, error)

GetProducts : Get all products

func (*Store) GetProductsByID

func (s *Store) GetProductsByID(productIDs []int) ([]types.Product, error)

GetProductsByID : Get products by ID

func (*Store) UpdateProduct

func (s *Store) UpdateProduct(product types.Product) error

UpdateProduct : Update a product

Jump to

Keyboard shortcuts

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