Documentation ¶
Index ¶
- type DataProvider
- type JDBCDataProvider
- func (jdbcDataProvider JDBCDataProvider) CheckLogin(username string, passwordSha string) int
- func (jdbcDataProvider JDBCDataProvider) DeleteReserve(reference string, username string, passwordSha string) int
- func (jdbcDataProvider JDBCDataProvider) GetFullProduct(reference string) (model.Product, int)
- func (jdbcDataProvider JDBCDataProvider) GetProducts() ([]model.Product, int)
- func (jdbcDataProvider JDBCDataProvider) GetReserves(username string, passwordSha string) ([]model.Reserve, int)
- func (jdbcDataProvider JDBCDataProvider) PostReserve(reference string, username string, passwordSha string) int
- type MockDataProvider
- func (mockDataProvider MockDataProvider) CheckLogin(username string, passwordSha string) (model.JSONHTTPResponse, int)
- func (mockDataProvider MockDataProvider) DeleteReserve(reference string, username string, passwordSha string) int
- func (mockDataProvider MockDataProvider) GetFullProduct(reference string) (model.Product, int)
- func (mockDataProvider MockDataProvider) GetProducts() ([]model.Product, int)
- func (mockDataProvider MockDataProvider) GetReserves(username string, passwordSha string) ([]model.Reserve, int)
- func (mockDataProvider MockDataProvider) PostReserve(reference string, username string, passwordSha string) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataProvider ¶
type DataProvider interface { GetProducts() ([]model.Product, int) GetFullProduct(reference string) (model.Product, int) GetReserves(username string, passwordSha string) ([]model.Reserve, int) PostReserve(reference string, username string, passwordSha string) int DeleteReserve(reference string, username string, passwordSha string) int CheckLogin(username string, passwordSha string) int }
DataProvider interfaz estandar para develover los datos de este API REST
func GetDataProvider ¶
func GetDataProvider() DataProvider
GetDataProvider devuelve el DataProvider seleccionado
type JDBCDataProvider ¶
type JDBCDataProvider struct{}
JDBCDataProvider conexión entre el API REST y la base de datos
func (JDBCDataProvider) CheckLogin ¶
func (jdbcDataProvider JDBCDataProvider) CheckLogin(username string, passwordSha string) int
CheckLogin comprueba si el usuario y la contraseña son correctos
func (JDBCDataProvider) DeleteReserve ¶
func (jdbcDataProvider JDBCDataProvider) DeleteReserve(reference string, username string, passwordSha string) int
DeleteReserve borra una reserva nueva para un usuario
func (JDBCDataProvider) GetFullProduct ¶
func (jdbcDataProvider JDBCDataProvider) GetFullProduct(reference string) (model.Product, int)
GetFullProduct devuelve el detalle de un producto
func (JDBCDataProvider) GetProducts ¶
func (jdbcDataProvider JDBCDataProvider) GetProducts() ([]model.Product, int)
GetProducts devuelve una lista de productos para el catálogo
func (JDBCDataProvider) GetReserves ¶
func (jdbcDataProvider JDBCDataProvider) GetReserves(username string, passwordSha string) ([]model.Reserve, int)
GetReserves devuelve la lista de reservas de un usuario
func (JDBCDataProvider) PostReserve ¶
func (jdbcDataProvider JDBCDataProvider) PostReserve(reference string, username string, passwordSha string) int
PostReserve crea una reserva nueva para un usuario
type MockDataProvider ¶
type MockDataProvider struct{}
MockDataProvider proveedor de datos de prueba
func (MockDataProvider) CheckLogin ¶
func (mockDataProvider MockDataProvider) CheckLogin(username string, passwordSha string) (model.JSONHTTPResponse, int)
CheckLogin comprueba si el usuario y la contraseña son correctos
func (MockDataProvider) DeleteReserve ¶
func (mockDataProvider MockDataProvider) DeleteReserve(reference string, username string, passwordSha string) int
DeleteReserve borra una reserva nueva para un usuario
func (MockDataProvider) GetFullProduct ¶
func (mockDataProvider MockDataProvider) GetFullProduct(reference string) (model.Product, int)
GetFullProduct devuelve el detalle de un producto
func (MockDataProvider) GetProducts ¶
func (mockDataProvider MockDataProvider) GetProducts() ([]model.Product, int)
GetProducts devuelve una lista de productos para el catálogo
func (MockDataProvider) GetReserves ¶
func (mockDataProvider MockDataProvider) GetReserves(username string, passwordSha string) ([]model.Reserve, int)
GetReserves devuelve la lista de reservas de un usuario
func (MockDataProvider) PostReserve ¶
func (mockDataProvider MockDataProvider) PostReserve(reference string, username string, passwordSha string) int
PostReserve crea una reserva nueva para un usuario