handlers

package
v0.0.0-...-23075f2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProduct

func CreateProduct(c *fiber.Ctx) error

func GetAllProducts

func GetAllProducts(c *fiber.Ctx) error

Types

type ErrorResponse

type ErrorResponse struct {
	FailedField string
	Tag         string
	Value       string
}

func ValidateProductsStruct

func ValidateProductsStruct(product Product) []*ErrorResponse

type Product

type Product struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id" validate:"required"`
	CreatedAt time.Time          `json:"createdAt" bson:"created_at" validate:"required"`
	UpdatedAt time.Time          `json:"updatedAt" bson:"updated_at" validate:"required"`
	Title     string             `json:"title" bson:"title" validate:"required,min=12"`
}

Jump to

Keyboard shortcuts

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