mysql

package
v0.0.0-...-895c7f9 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(user, pass, host, port, name string) (*sqlx.DB, error)

InitDB establishes a connection with the database

Types

type LinkService

type LinkService struct {
	DB *sqlx.DB
}

LinkService ...

func (*LinkService) Create

func (s *LinkService) Create(l *shopy.Link) error

Create ...

func (*LinkService) Delete

func (s *LinkService) Delete(hash string) error

Delete ...

func (*LinkService) Get

func (s *LinkService) Get(hash string) (*shopy.Link, error)

Get ...

func (*LinkService) Gets

func (s *LinkService) Gets(first, limit int, order string) ([]*shopy.Link, error)

Gets ...

func (*LinkService) Update

func (s *LinkService) Update(l *shopy.Link, fields ...string) error

Update ...

type OrderService

type OrderService struct {
	DB *sqlx.DB
}

OrderService ...

func (*OrderService) Create

func (s *OrderService) Create(o *shopy.Order) error

Create ...

func (*OrderService) Delete

func (s *OrderService) Delete(id int) error

Delete ...

func (*OrderService) Get

func (s *OrderService) Get(id int) (*shopy.Order, error)

Get ...

func (*OrderService) GetByPayPal

func (s *OrderService) GetByPayPal(token string) (*shopy.Order, error)

GetByPayPal ...

func (*OrderService) Gets

func (s *OrderService) Gets(first, limit int, order string) ([]*shopy.Order, error)

Gets ...

func (*OrderService) GetsWhere

func (s *OrderService) GetsWhere(first, limit int, order, where, sth string) ([]*shopy.Order, error)

GetsWhere ...

func (*OrderService) Total

func (s *OrderService) Total() (int, error)

Total ...

func (*OrderService) Update

func (s *OrderService) Update(o *shopy.Order, fields ...string) error

Update ...

type ProductService

type ProductService struct {
	DB *sqlx.DB
}

ProductService ...

func (*ProductService) Create

func (s *ProductService) Create(p *shopy.Product) error

Create ...

func (*ProductService) Delete

func (s *ProductService) Delete(id int) error

Delete ...

func (*ProductService) Get

func (s *ProductService) Get(id int) (*shopy.Product, error)

Get ...

func (*ProductService) Gets

func (s *ProductService) Gets(first, limit int, order string) ([]*shopy.Product, error)

Gets ...

func (*ProductService) GetsWhere

func (s *ProductService) GetsWhere(first, limit int, order, where, sth string) ([]*shopy.Product, error)

GetsWhere ...

func (*ProductService) GetsWhereIn

func (s *ProductService) GetsWhereIn(first, limit int, order, where, in string) ([]*shopy.Product, error)

GetsWhereIn ...

func (*ProductService) Total

func (s *ProductService) Total() (int, error)

Total ...

func (*ProductService) Update

func (s *ProductService) Update(p *shopy.Product, fields ...string) error

Update ...

type PromocodeService

type PromocodeService struct {
	DB *sqlx.DB
}

PromocodeService ...

func (*PromocodeService) Create

func (s *PromocodeService) Create(p *shopy.Promocode) error

Create ...

func (*PromocodeService) Delete

func (s *PromocodeService) Delete(id int) error

Delete ...

func (*PromocodeService) Get

func (s *PromocodeService) Get(id int) (*shopy.Promocode, error)

Get ...

func (*PromocodeService) GetByCode

func (s *PromocodeService) GetByCode(code string) (*shopy.Promocode, error)

GetByCode ...

func (*PromocodeService) Gets

func (s *PromocodeService) Gets(first, limit int, order string) ([]*shopy.Promocode, error)

Gets ...

func (*PromocodeService) Total

func (s *PromocodeService) Total() (int, error)

Total ...

func (*PromocodeService) Update

func (s *PromocodeService) Update(p *shopy.Promocode, fields ...string) error

Update ...

type UserService

type UserService struct {
	DB *sqlx.DB
}

UserService ...

func (*UserService) Create

func (s *UserService) Create(u *shopy.User) error

Create ...

func (*UserService) Delete

func (s *UserService) Delete(id int) error

Delete ...

func (*UserService) Get

func (s *UserService) Get(id int) (*shopy.User, error)

Get ...

func (*UserService) GetByEmail

func (s *UserService) GetByEmail(email string) (*shopy.User, error)

GetByEmail ...

func (*UserService) GetByReferral

func (s *UserService) GetByReferral(referral string) (*shopy.User, error)

GetByReferral ...

func (*UserService) Gets

func (s *UserService) Gets(first, limit int, order string) ([]*shopy.User, error)

Gets ...

func (*UserService) Total

func (s *UserService) Total() (int, error)

Total ...

func (*UserService) Update

func (s *UserService) Update(u *shopy.User, fields ...string) error

Update ...

Jump to

Keyboard shortcuts

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