controllers

package
v0.0.0-...-ceb7878 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBrand

func AddBrand(ctx iris.Context)

AddBrand add new brand

func AddBrandCollection

func AddBrandCollection(ctx iris.Context)

AddBrandCollection add collection to brand

func AddProduct

func AddProduct(ctx iris.Context)

AddProduct add new product

func DeleteBrand

func DeleteBrand(ctx iris.Context)

DeleteBrand delete a brand

func DeleteBrandCollection

func DeleteBrandCollection(ctx iris.Context)

DeleteBrandCollection delete a Brand's Collection

func DeleteProduct

func DeleteProduct(ctx iris.Context)

DeleteProduct delete a product

func EditBrand

func EditBrand(ctx iris.Context)

EditBrand edit brand by id

func EditBrandCollection

func EditBrandCollection(ctx iris.Context)

EditBrandCollection edit brand's collection

func EditProduct

func EditProduct(ctx iris.Context)

EditProduct edit brand by id

func GetAll

func GetAll(string, orderBy string, offset, limit int, sort string) *gorm.DB

GetAll reusable func

func GetBrand

func GetBrand(ctx iris.Context)

GetBrand return brand info by giving brand id

func GetBrandCollection

func GetBrandCollection(ctx iris.Context)

GetBrandCollection Get a brand's collection

func GetBrandCollectionProducts

func GetBrandCollectionProducts(ctx iris.Context)

GetBrandCollectionProducts get products of brandCollection

func GetBrandCollections

func GetBrandCollections(ctx iris.Context)

GetBrandCollections get all collections of brand

func GetBrands

func GetBrands(ctx iris.Context)

GetBrands get brands

func GetErrorStatus

func GetErrorStatus(err error) int

GetErrorStatus give error and return http status code

func GetProduct

func GetProduct(ctx iris.Context)

GetProduct get a product by id

func GetProducts

func GetProducts(ctx iris.Context)

GetProducts get products

Types

type Lists

type Lists struct {
	Data  interface{} `json:"data"`
	Total int         `json:"total"`
}

Lists Response list structure

type Response

type Response struct {
	Status bool        `json:"status"`
	Msg    interface{} `json:"msg"`
	Data   interface{} `json:"data"`
}

Response Structure

func APIResponse

func APIResponse(status bool, objects interface{}, msg string) (r *Response)

APIResponse is helper for giving response

Jump to

Keyboard shortcuts

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