Documentation ¶
Index ¶
- Variables
- type DBLayer
- type DBORM
- func (db *DBORM) AddOrder(order models.Order) error
- func (db *DBORM) AddUser(customer models.Customer) (models.Customer, error)
- func (db *DBORM) GetAllProducts() (products []models.Product, err error)
- func (db *DBORM) GetCreditCardCID(id int) (string, error)
- func (db *DBORM) GetCustomerByID(id int) (customer models.Customer, err error)
- func (db *DBORM) GetCustomerByName(firstname string, lastname string) (customer models.Customer, err error)
- func (db *DBORM) GetCustomerOrdersByID(id int) (orders []models.Order, err error)
- func (db *DBORM) GetProduct(id int) (product models.Product, error error)
- func (db *DBORM) GetPromos() (products []models.Product, err error)
- func (db *DBORM) SaveCreditCardForCustomer(id int, ccid string) error
- func (db *DBORM) SignInUser(email, pass string) (customer models.Customer, err error)
- func (db *DBORM) SignOutUserById(id int) error
- type MockDBLayer
- func (mock *MockDBLayer) AddOrder(order models.Order) error
- func (mock *MockDBLayer) AddUser(customer models.Customer) (models.Customer, error)
- func (mock *MockDBLayer) GetAllProducts() ([]models.Product, error)
- func (mock *MockDBLayer) GetCreditCardCID(id int) (string, error)
- func (mock *MockDBLayer) GetCustomerByID(id int) (models.Customer, error)
- func (mock *MockDBLayer) GetCustomerByName(first, last string) (models.Customer, error)
- func (mock *MockDBLayer) GetCustomerOrdersByID(id int) ([]models.Order, error)
- func (mock *MockDBLayer) GetMockCustomersData() []models.Customer
- func (mock *MockDBLayer) GetMockOrdersData() []models.Order
- func (mock *MockDBLayer) GetMockProductData() []models.Product
- func (mock *MockDBLayer) GetProduct(id int) (models.Product, error)
- func (mock *MockDBLayer) GetPromos() ([]models.Product, error)
- func (mock *MockDBLayer) SaveCreditCardForCustomer(int, string) error
- func (mock *MockDBLayer) SetError(err error)
- func (mock *MockDBLayer) SignInUser(email, password string) (models.Customer, error)
- func (mock *MockDBLayer) SignOutUserById(id int) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrINVALIDPASSWORD = errors.New("Invalid password")
Functions ¶
This section is empty.
Types ¶
type DBLayer ¶
type DBLayer interface { GetAllProducts() ([]models.Product, error) GetPromos() ([]models.Product, error) GetCustomerByName(string, string) (models.Customer, error) GetCustomerByID(int) (models.Customer, error) GetProduct(int) (models.Product, error) AddUser(models.Customer) (models.Customer, error) SignInUser(username, password string) (models.Customer, error) SignOutUserById(int) error GetCustomerOrdersByID(int) ([]models.Order, error) AddOrder(models.Order) error GetCreditCardCID(int) (string, error) SaveCreditCardForCustomer(int, string) error }
type DBORM ¶
func (*DBORM) GetAllProducts ¶
func (*DBORM) GetCustomerByID ¶
func (*DBORM) GetCustomerByName ¶
func (*DBORM) GetCustomerOrdersByID ¶
func (*DBORM) GetProduct ¶
func (*DBORM) SaveCreditCardForCustomer ¶
func (*DBORM) SignInUser ¶
func (*DBORM) SignOutUserById ¶
type MockDBLayer ¶
type MockDBLayer struct {
// contains filtered or unexported fields
}
func NewMockDBLayer ¶
func NewMockDBLayerWithData ¶
func NewMockDBLayerWithData() *MockDBLayer
func (*MockDBLayer) GetAllProducts ¶
func (mock *MockDBLayer) GetAllProducts() ([]models.Product, error)
func (*MockDBLayer) GetCreditCardCID ¶
func (mock *MockDBLayer) GetCreditCardCID(id int) (string, error)
func (*MockDBLayer) GetCustomerByID ¶
func (mock *MockDBLayer) GetCustomerByID(id int) (models.Customer, error)
func (*MockDBLayer) GetCustomerByName ¶
func (mock *MockDBLayer) GetCustomerByName(first, last string) (models.Customer, error)
func (*MockDBLayer) GetCustomerOrdersByID ¶
func (mock *MockDBLayer) GetCustomerOrdersByID(id int) ([]models.Order, error)
func (*MockDBLayer) GetMockCustomersData ¶
func (mock *MockDBLayer) GetMockCustomersData() []models.Customer
func (*MockDBLayer) GetMockOrdersData ¶
func (mock *MockDBLayer) GetMockOrdersData() []models.Order
func (*MockDBLayer) GetMockProductData ¶
func (mock *MockDBLayer) GetMockProductData() []models.Product
func (*MockDBLayer) GetProduct ¶
func (mock *MockDBLayer) GetProduct(id int) (models.Product, error)
func (*MockDBLayer) SaveCreditCardForCustomer ¶
func (mock *MockDBLayer) SaveCreditCardForCustomer(int, string) error
func (*MockDBLayer) SetError ¶
func (mock *MockDBLayer) SetError(err error)
func (*MockDBLayer) SignInUser ¶
func (mock *MockDBLayer) SignInUser(email, password string) (models.Customer, error)
func (*MockDBLayer) SignOutUserById ¶
func (mock *MockDBLayer) SignOutUserById(id int) error
Click to show internal directories.
Click to hide internal directories.