model

package
v0.0.0-...-d0b6f7e Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPResponse

type HTTPResponse struct {
	Code        int    `json:"code"`
	Description string `json:"description"`
	ExtraText   string `json:"extra_text"`
}

HTTPResponse el contenido de la JSONHTTPResponse

type JSONHTTPResponse

type JSONHTTPResponse struct {
	HTTPResponse HTTPResponse `json:"http_response"`
}

JSONHTTPResponse respuesta JSON que indica el código HTTP y algún comentario extra

type JSONText

type JSONText struct {
	Text string `json:"text"`
}

JSONText estructura básica de envio de texto

type Product

type Product struct {
	Reference        string      `json:"reference"`
	Name             string      `json:"name"`
	ImagePath        string      `json:"imagePath"`        // `json:"image_path"`
	ShortDescription string      `json:"shortDescription"` // `json:"short_description"`
	ProductInfo      ProductInfo `json:"productInfo"`      // `json:"product_info"`
}

Product se la definición resumida de un poroducto

type ProductInfo

type ProductInfo struct {
	Description     string  `json:"description"`
	Price           float32 `json:"price"`
	AvailableAmount int     `json:"availableAmount"` // `json:"available_amount"`
}

ProductInfo son los detalles extra de cada producto

type Reserve

type Reserve struct {
	Product     Product `json:"product"`
	ReserveDate int64   `json:"reserveDate"` // `json:"reserve_date"`
}

Reserve devuelve los datos de un producto reservado en una fecha

type User

type User struct {
	Username                string
	ConcatenatedPasswordSha string
	Salt                    string
}

User representación de un usuario en la DB

func (User) CheckPassword

func (user User) CheckPassword(passwordSha string) bool

CheckPassword comprueba si la contraseña introducida es correcta

Jump to

Keyboard shortcuts

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