repository

package
v0.0.0-...-5e9bb57 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PaymentsRepository

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

PaymentsRepository provides access to the payments database.

func New

func New(db *badger.DB) *PaymentsRepository

New creates a new repository using SQLite database.

func (*PaymentsRepository) Add

func (r *PaymentsRepository) Add(payment *domain.Payment) (string, error)

Add adds a payment to the database.

func (*PaymentsRepository) Delete

func (r *PaymentsRepository) Delete(id string) error

Delete deletes a payment from the database.

func (*PaymentsRepository) Exists

func (r *PaymentsRepository) Exists(id string) bool

Exists is a helper function to check if payment with give ID exists.

func (*PaymentsRepository) Get

func (r *PaymentsRepository) Get(id string) (*domain.Payment, error)

Get retrieves single payment from the database.

func (*PaymentsRepository) GetAll

func (r *PaymentsRepository) GetAll() ([]*domain.Payment, error)

GetAll retrieves all payments from the database.

func (*PaymentsRepository) Update

func (r *PaymentsRepository) Update(payment *domain.Payment) error

Update updates a payment in the database.

Jump to

Keyboard shortcuts

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