bbolt

package
v0.0.0-...-4d895cd Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountsBucket = []byte("accounts")
View Source
var AppConfigBucket = []byte("app_config")
View Source
var ContactsBucket = []byte("contacts")
View Source
var CurrencyRatesBucket = []byte("currency_rates")
View Source
var InvoicesBucket = []byte("invoices")
View Source
var InvoicesTemplatesBucket = []byte("invoices_templates")
View Source
var PeriodsBucket = []byte("periods") //nolint:gochecknoglobals
View Source
var TransactionsBucket = []byte("transactions")

Functions

This section is empty.

Types

type AccountsRepository

type AccountsRepository struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewAccountsRepository

func NewAccountsRepository(bolt *resources.Bolt) *AccountsRepository

func (*AccountsRepository) Create

func (*AccountsRepository) Delete

func (r *AccountsRepository) Delete(_ context.Context, id uint64) error

func (*AccountsRepository) GetAll

func (r *AccountsRepository) GetAll(ctx context.Context, withDeleted *bool) ([]entities.Account, error)

func (*AccountsRepository) GetByID

func (*AccountsRepository) GetName

func (r *AccountsRepository) GetName() string

func (*AccountsRepository) Start

func (r *AccountsRepository) Start() error

func (*AccountsRepository) Update

type AppConfigRepository

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

func NewAppConfigRepository

func NewAppConfigRepository(bolt *resources.Bolt) *AppConfigRepository

func (*AppConfigRepository) Get

func (*AppConfigRepository) GetFinancialYearStart

func (r *AppConfigRepository) GetFinancialYearStart() time.Time

func (*AppConfigRepository) GetName

func (r *AppConfigRepository) GetName() string

func (*AppConfigRepository) GetStartDate

func (r *AppConfigRepository) GetStartDate() (*datetime.Date, error)

func (*AppConfigRepository) SetStartDateTx

func (r *AppConfigRepository) SetStartDateTx(_ context.Context, tx *bbolt.Tx, date datetime.Date) error

func (*AppConfigRepository) Start

func (r *AppConfigRepository) Start() error

type ContactsRepository

type ContactsRepository struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewContactsRepository

func NewContactsRepository(db *resources.Bolt) *ContactsRepository

func (*ContactsRepository) Create

func (*ContactsRepository) GetAll

func (r *ContactsRepository) GetAll(_ context.Context, withDeleted *bool) ([]entities.Contact, error)

func (*ContactsRepository) GetByID

func (*ContactsRepository) GetName

func (r *ContactsRepository) GetName() string

func (*ContactsRepository) Remove

func (r *ContactsRepository) Remove(ctx context.Context, ID uint64) error

func (*ContactsRepository) RemoveQRCode

func (r *ContactsRepository) RemoveQRCode(_ context.Context, contactID uint64, bankName string) error

func (*ContactsRepository) SetQRCode

func (r *ContactsRepository) SetQRCode(_ context.Context, contactID uint64, qrCode entities.QRCode) error

func (*ContactsRepository) Start

func (r *ContactsRepository) Start() error

func (*ContactsRepository) Update

func (r *ContactsRepository) Update(_ context.Context, contact entities.Contact) error

type CurrencyRatesRepository

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

func NewCurrencyRatesRepository

func NewCurrencyRatesRepository(bolt *resources.Bolt) *CurrencyRatesRepository

func (*CurrencyRatesRepository) GetCurrencyRateByDate

func (r *CurrencyRatesRepository) GetCurrencyRateByDate(_ context.Context, code currency.Code, date datetime.Date) (float64, error)

func (*CurrencyRatesRepository) GetName

func (r *CurrencyRatesRepository) GetName() string

func (*CurrencyRatesRepository) Start

func (r *CurrencyRatesRepository) Start() error

type DateTimeProvider

type DateTimeProvider interface {
	Now() datetime.DateTime
}

type InvoicesRepository

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

func NewInvoicesRepository

func NewInvoicesRepository(db *resources.Bolt) *InvoicesRepository

func (*InvoicesRepository) CreateTx

func (r *InvoicesRepository) CreateTx(tx *bbolt.Tx, invoice entities.Invoice) (*entities.Invoice, error)

func (*InvoicesRepository) DeleteTx

func (r *InvoicesRepository) DeleteTx(tx *bbolt.Tx, id uint64) error

func (*InvoicesRepository) FindByDates

func (*InvoicesRepository) GetByID

func (*InvoicesRepository) GetByTemplateID

func (r *InvoicesRepository) GetByTemplateID(_ context.Context, id uint64) ([]entities.Invoice, error)

func (*InvoicesRepository) GetName

func (r *InvoicesRepository) GetName() string

func (*InvoicesRepository) Start

func (r *InvoicesRepository) Start() error

func (*InvoicesRepository) UpdateTx

func (r *InvoicesRepository) UpdateTx(tx *bbolt.Tx, invoice entities.Invoice) (*entities.Invoice, error)

type InvoicesTemplatesRepository

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

func NewInvoicesTemplatesRepository

func NewInvoicesTemplatesRepository(db *resources.Bolt) *InvoicesTemplatesRepository

func (*InvoicesTemplatesRepository) CreateTx

func (*InvoicesTemplatesRepository) DeleteTx

func (r *InvoicesTemplatesRepository) DeleteTx(tx *bbolt.Tx, id uint64) error

func (*InvoicesTemplatesRepository) GetName

func (r *InvoicesTemplatesRepository) GetName() string

func (*InvoicesTemplatesRepository) Start

type PeriodsRepository

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

func NewPeriodsRepository

func NewPeriodsRepository(db *resources.Bolt, provider DateTimeProvider) *PeriodsRepository

func (*PeriodsRepository) Create

func (r *PeriodsRepository) Create(ctx context.Context, period entities.Period) (*entities.Period, error)

func (*PeriodsRepository) CreateTx

func (r *PeriodsRepository) CreateTx(
	_ context.Context,
	tx *bbolt.Tx,
	period entities.Period,
) (*entities.Period, error)

func (*PeriodsRepository) GetAll

func (r *PeriodsRepository) GetAll(_ context.Context, limit *uint64, offset *uint64) ([]entities.Period, error)

func (*PeriodsRepository) GetByID

func (*PeriodsRepository) GetCount

func (r *PeriodsRepository) GetCount(_ context.Context) (uint64, error)

func (*PeriodsRepository) GetLast

func (*PeriodsRepository) GetName

func (r *PeriodsRepository) GetName() string

func (*PeriodsRepository) Start

func (r *PeriodsRepository) Start() error

type Repository

type Repository interface {
	Start() error
	GetName() string
}

type Service

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

func NewService

func NewService(repositories ...Repository) *Service

func (*Service) Start

func (s *Service) Start()

func (*Service) Stop

func (s *Service) Stop()

type Transactor

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

func NewTransactor

func NewTransactor(db *resources.Bolt) *Transactor

func (*Transactor) Transaction

func (d *Transactor) Transaction(ctx context.Context, fn func(ctx context.Context) error) error

Jump to

Keyboard shortcuts

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