Documentation
¶
Index ¶
- Constants
- type AuthService
- type CustomerService
- func (uc CustomerService) AddFavorites(customerId bson.ObjectId, productIds []bson.ObjectId) (bool, error)
- func (uc CustomerService) CreateCustomer(user models.Customer) error
- func (uc CustomerService) GetAll() ([]models.Customer, error)
- func (uc CustomerService) GetCustomer(oid bson.ObjectId) (models.Customer, error)
- func (uc CustomerService) RemoveCustomer(oid bson.ObjectId) bool
- func (uc CustomerService) UpdateCustomer(oid bson.ObjectId, user models.Customer) (models.Customer, error)
- type ProductService
- func (uc ProductService) CreateProduct(user models.Product) error
- func (uc ProductService) GetAll(page int) ([]models.Product, error)
- func (uc ProductService) GetProduct(oid bson.ObjectId) (models.Product, error)
- func (uc ProductService) RemoveProduct(oid bson.ObjectId) bool
- func (uc ProductService) UpdateProduct(oid bson.ObjectId, user models.Product) (models.Product, error)
Constants ¶
View Source
const ( PRODUCT_NOT_FOUND = "The product %s does not exist" PRODUCT_HAS_EXISTS_TO_USER = "The product %s is already linked to that customer" )
View Source
const (
LIMIT_PAGE = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(s *mgo.Session) *AuthService
type CustomerService ¶
type CustomerService struct {
// contains filtered or unexported fields
}
func NewCustomerService ¶
func NewCustomerService(s *mgo.Session) *CustomerService
func (CustomerService) AddFavorites ¶
func (CustomerService) CreateCustomer ¶
func (uc CustomerService) CreateCustomer(user models.Customer) error
func (CustomerService) GetCustomer ¶
func (CustomerService) RemoveCustomer ¶
func (uc CustomerService) RemoveCustomer(oid bson.ObjectId) bool
func (CustomerService) UpdateCustomer ¶
type ProductService ¶
type ProductService struct {
// contains filtered or unexported fields
}
func NewProductService ¶
func NewProductService(s *mgo.Session) *ProductService
func (ProductService) CreateProduct ¶
func (uc ProductService) CreateProduct(user models.Product) error
func (ProductService) GetProduct ¶
func (ProductService) RemoveProduct ¶
func (uc ProductService) RemoveProduct(oid bson.ObjectId) bool
func (ProductService) UpdateProduct ¶
Click to show internal directories.
Click to hide internal directories.