api

package
v0.0.0-...-9abd94b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCategoryItems

func GetCategoryItems(w http.ResponseWriter, r *http.Request)

func GetDepartmentCategories

func GetDepartmentCategories(w http.ResponseWriter, r *http.Request)

func GetDepartments

func GetDepartments(w http.ResponseWriter, r *http.Request)

func GetItem

func GetItem(w http.ResponseWriter, r *http.Request)

func IsAuthorized

func IsAuthorized(next http.Handler) http.Handler

func Login

func Login(w http.ResponseWriter, req *http.Request)

func Logout

func Logout(w http.ResponseWriter, req *http.Request)

func ProtectedEndpoint

func ProtectedEndpoint(w http.ResponseWriter, req *http.Request)

func ServeFileHandler

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

func Signup

func Signup(w http.ResponseWriter, req *http.Request)

func TestEndpoint

func TestEndpoint(w http.ResponseWriter, req *http.Request)

func VerifyUser

func VerifyUser(usr User) (*user.User, error)

Types

type ErrorResponse

type ErrorResponse struct {
	Code  int
	Error string
}

type Exception

type Exception struct {
	Message string `json:"message"`
}

type Item

type Item struct {
	ID          uint     `json:"item_id"`
	Name        string   `json:"item_name"`
	StoreName   string   `json:"store_name"`
	PromoImage  string   `json:"default_image"`
	Images      []string `json:"images"`
	Description string   `json:"description"`
	Price       float64  `json:"price"`
	Stock       uint     `json:"stock"`
}

func StoreItemToAPIItem

func StoreItemToAPIItem(item *store.Item) *Item

type JwtToken

type JwtToken struct {
	Token string `json:"token"`
}

type Response

type Response struct {
	Code   int
	Result interface{}
}

type Store

type Store struct {
	ID       uint
	Name     string
	Image    string
	Catalogs []*Item
}

type User

type User struct {
	ID        uint
	Email     string
	FirstName string
	LastName  string
	Password  string
	Phone     string
}

Jump to

Keyboard shortcuts

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