Documentation ¶
Index ¶
- func HealthHandler(res http.ResponseWriter, req *http.Request)
- func HomeHandler(res http.ResponseWriter, req *http.Request)
- type ProductHandler
- func (p ProductHandler) CreateHandler(res http.ResponseWriter, req *http.Request)
- func (p ProductHandler) DestroyHandler(res http.ResponseWriter, req *http.Request)
- func (p ProductHandler) IndexHandler(res http.ResponseWriter, req *http.Request)
- func (p ProductHandler) ShowHandler(res http.ResponseWriter, req *http.Request)
- func (p ProductHandler) UpdateHandler(res http.ResponseWriter, req *http.Request)
- type ProductRepo
- type ResponseHealth
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. |
Click to show internal directories.
Click to hide internal directories.