Documentation ¶
Index ¶
Constants ¶
View Source
const ( DbName = "xxxxx" CollectionName = "xxxxxxxxxxxx" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaymentService ¶
type PaymentService struct {
// contains filtered or unexported fields
}
PaymentService holds the collection
func NewPaymentService ¶
func NewPaymentService(session *mgo.Session, db string, col string) *PaymentService
NewPaymentService creates a new payment service
func (*PaymentService) CreatePayment ¶
func (p *PaymentService) CreatePayment(u *models.Payment) error
CreatePayment creates a new payment
func (*PaymentService) DeletePayment ¶
func (p *PaymentService) DeletePayment(id string) error
DeletePayment deletes it
func (*PaymentService) GetPaymentsByIDs ¶
func (p *PaymentService) GetPaymentsByIDs(ids []string) ([]models.Payment, error)
GetPaymentsByIDs gets a list of payments
func (*PaymentService) UpdatePayment ¶
func (p *PaymentService) UpdatePayment(u *models.Payment) error
UpdatePayment updates a payment by some id
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is the mongodb session
func NewSession ¶
NewSession creates a new session to work with. Connection url should be moved to some config files
func (*Session) DeleteCollection ¶
DeleteCollection delets a collection (for testing)
Click to show internal directories.
Click to hide internal directories.