db

package
v0.0.0-...-58bfa7f Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	// IsOnline returns a value indicating whether the database is online.
	IsOnline() bool
	// Payments allows for accessing methods used to perform CRUD operations on payments.
	Payments() PaymentsDatabase
}

Database represents the database where data will be stored.

func NewMongoDDatabase

func NewMongoDDatabase(mongodbURL, databaseName string) (Database, error)

NewMongoDDatabase returns a new instance of Database powered by MongoDB.

type PaymentsDatabase

type PaymentsDatabase interface {
	// CreatePayment creates the provided payment.
	CreatePayment(models.Payment) (models.Payment, error)
	// DeletePayment deletes the payment with the specified ID.
	DeletePayment(string) (bool, error)
	// GetPayment returns the payment with the specified ID.
	GetPayment(string) (models.Payment, error)
	// ListPayments lists all registered payments.
	ListPayments() ([]models.Payment, error)
	// UpdatePayment updates the payment with the specified ID.
	UpdatePayment(string, models.Payment) (models.Payment, error)
}

PaymentsDatabase contains methods used to perform CRUD operations on payments.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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