products

package
v0.0.0-...-77a91a8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(ctx context.Context, s Service, router *mux.Router) http.Handler

Types

type Product

type Product struct {
	Id        string  `json:"id"`
	Name      string  `json:"name"`
	Price     float64 `json:"price"`
	Inventory int     `json:"inventory"`
}

type Service

type Service interface {
	CreateProduct(product Product) (string, error)
	GetAllProducts() ([]Product, error)
}

func NewService

func NewService(repo mongo.Repository) Service

Jump to

Keyboard shortcuts

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