Documentation ¶
Index ¶
- type PaymentsRepository
- func (r *PaymentsRepository) Add(payment *domain.Payment) (string, error)
- func (r *PaymentsRepository) Delete(id string) error
- func (r *PaymentsRepository) Exists(id string) bool
- func (r *PaymentsRepository) Get(id string) (*domain.Payment, error)
- func (r *PaymentsRepository) GetAll() ([]*domain.Payment, error)
- func (r *PaymentsRepository) Update(payment *domain.Payment) error
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.
Click to show internal directories.
Click to hide internal directories.