productservice

package
v0.0.0-...-754da63 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 10 Imported by: 0

README

Add Product

curl http://localhost:9090/product/addprod --request POST --header 'Productname:prod2' --header 'Productvendor:vendor2' --header 'Productinventory:6' --header 'Productdescription:description is here'

Get All Products

curl http://localhost:9090/product/getprods --request GET

Get One Product by Id

curl http://localhost:9090/product/getprodbyid --request GET --header 'Id:1'

Delete Product by Id

curl http://localhost:9090/product/deletebyid --request DELETE --header 'Id:2'

Custom Query Examples

curl http://localhost:9090/product/customquery --request GET --header 'Type:get' --header 'Query:SELECT name FROM products;'

curl http://localhost:9090/product/customquery --request GET --header 'Type:get' --header "Query:UPDATE products SET name = \"prod1\" WHERE id = 3;"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSecret

func GetSecret() string

Types

type ProductController

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

ProductController is the getproduct route handler

func NewProductController

func NewProductController(logger *zap.Logger) *ProductController

NewProductController returns a frsh Upload controller

func (*ProductController) AddProductHandler

func (ctrl *ProductController) AddProductHandler(rw http.ResponseWriter, r *http.Request)

func (*ProductController) CustomQueryHandler

func (ctrl *ProductController) CustomQueryHandler(rw http.ResponseWriter, r *http.Request)

func (*ProductController) DeleteProductHandler

func (ctrl *ProductController) DeleteProductHandler(rw http.ResponseWriter, r *http.Request)

func (*ProductController) GetAllProductByIdHandler

func (ctrl *ProductController) GetAllProductByIdHandler(rw http.ResponseWriter, r *http.Request)

func (*ProductController) GetAllProductsHandler

func (ctrl *ProductController) GetAllProductsHandler(rw http.ResponseWriter, r *http.Request)

func (*ProductController) InitGormConnection

func (ctrl *ProductController) InitGormConnection()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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