services

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

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

Go to latest
Published: Feb 26, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

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

func (AuthService) HasUser

func (uc AuthService) HasUser(username string, password string) bool

type CustomerService

type CustomerService struct {
	// contains filtered or unexported fields
}

func NewCustomerService

func NewCustomerService(s *mgo.Session) *CustomerService

func (CustomerService) AddFavorites

func (uc CustomerService) AddFavorites(customerId bson.ObjectId, productIds []bson.ObjectId) (bool, error)

func (CustomerService) CreateCustomer

func (uc CustomerService) CreateCustomer(user models.Customer) error

func (CustomerService) GetAll

func (uc CustomerService) GetAll() ([]models.Customer, error)

func (CustomerService) GetCustomer

func (uc CustomerService) GetCustomer(oid bson.ObjectId) (models.Customer, error)

func (CustomerService) RemoveCustomer

func (uc CustomerService) RemoveCustomer(oid bson.ObjectId) bool

func (CustomerService) UpdateCustomer

func (uc CustomerService) UpdateCustomer(oid bson.ObjectId, user models.Customer) (models.Customer, error)

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) GetAll

func (uc ProductService) GetAll(page int) ([]models.Product, error)

func (ProductService) GetProduct

func (uc ProductService) GetProduct(oid bson.ObjectId) (models.Product, error)

func (ProductService) RemoveProduct

func (uc ProductService) RemoveProduct(oid bson.ObjectId) bool

func (ProductService) UpdateProduct

func (uc ProductService) UpdateProduct(oid bson.ObjectId, user models.Product) (models.Product, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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