handlers

package
v0.0.0-...-acbba05 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthHandler

func HealthHandler(res http.ResponseWriter, req *http.Request)

func HomeHandler

func HomeHandler(res http.ResponseWriter, req *http.Request)

Types

type ProductHandler

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

func NewProductHandler

func NewProductHandler(logger *zap.Logger, productRepo ProductRepo) *ProductHandler

func (ProductHandler) CreateHandler

func (p ProductHandler) CreateHandler(res http.ResponseWriter, req *http.Request)

func (ProductHandler) DestroyHandler

func (p ProductHandler) DestroyHandler(res http.ResponseWriter, req *http.Request)

func (ProductHandler) IndexHandler

func (p ProductHandler) IndexHandler(res http.ResponseWriter, req *http.Request)

func (ProductHandler) ShowHandler

func (p ProductHandler) ShowHandler(res http.ResponseWriter, req *http.Request)

func (ProductHandler) UpdateHandler

func (p ProductHandler) UpdateHandler(res http.ResponseWriter, req *http.Request)

type ProductRepo

type ProductRepo interface {
	All(ctx context.Context) (*[]models.Product, error)
	Find(ctx context.Context, id int) (*models.Product, error)
	Create(ctx context.Context, product *models.Product) error
	Update(ctx context.Context, product *models.Product) error
	Destroy(ctx context.Context, id int) error
}

type ResponseHealth

type ResponseHealth struct {
	Status string `json:"status"`
}

Directories

Path Synopsis
Package mock_handlers is a generated GoMock package.
Package mock_handlers is a generated GoMock package.

Jump to

Keyboard shortcuts

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