inmemory

package
v0.0.0-...-1caa4a4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

Account is used to acces inmemory storage.

func NewAccount

func NewAccount() *Account

NewAccount returns new account inmemory storage.

func (*Account) Delete

func (s *Account) Delete(a *model.Account)

Delete removes account from current inmemory storage.

func (*Account) GetAll

func (s *Account) GetAll() []*model.Account

GetAll returns slice of accounts.

func (*Account) GetByID

func (s *Account) GetByID(id int64) *model.Account

GetByID returns account by its id.

func (*Account) GetByName

func (s *Account) GetByName(name string) *model.Account

GetByName returns account by its name.

func (*Account) Init

func (s *Account) Init(aa []*model.Account)

Init initialize inmemory storage with given slice of data.

func (*Account) Insert

func (s *Account) Insert(a *model.Account)

Insert appends account to inmemory storage.

func (*Account) Update

func (s *Account) Update(a *model.Account)

Update updates currency of inmemory storage.

type Category

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

Category is used to acces inmemory storage.

func NewCategory

func NewCategory() *Category

NewCategory returns new category inmemory storage.

func (*Category) Delete

func (s *Category) Delete(c *model.Category)

Delete removes category from current inmemory storage.

func (*Category) GetAll

func (s *Category) GetAll() []*model.Category

GetAll returns slice of categories.

func (*Category) GetByID

func (s *Category) GetByID(id int64) *model.Category

GetByID returns category by its id.

func (*Category) GetByTitle

func (s *Category) GetByTitle(title string) *model.Category

GetByID returns category by its title.

func (*Category) Init

func (s *Category) Init(cc []*model.Category)

Init initialize inmemory storage with given slice of data.

func (*Category) Insert

func (s *Category) Insert(c *model.Category)

Insert appends category to inmemory storage.

func (*Category) Update

func (s *Category) Update(c *model.Category)

Update updates category of inmemory storage.

type Currency

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

Currency is used to acces inmemory storage.

func NewCurrency

func NewCurrency() *Currency

NewCurrency returns new currency inmemory storage.

func (*Currency) Delete

func (s *Currency) Delete(c *model.Currency)

Delete removes currency from current inmemory storage.

func (*Currency) GetAll

func (s *Currency) GetAll() []*model.Currency

GetAll returns slice of currencies.

func (*Currency) GetByAbbreviation

func (s *Currency) GetByAbbreviation(abbreviation string) *model.Currency

GetByAbbreviation returns currency by its abbreviation.

func (*Currency) GetByID

func (s *Currency) GetByID(id int64) *model.Currency

GetByID returns currency by its id.

func (*Currency) Init

func (s *Currency) Init(cc []*model.Currency)

Init initialize inmemory storage with given slice of data.

func (*Currency) Insert

func (s *Currency) Insert(c *model.Currency)

Insert appends currency to inmemory storage.

func (*Currency) Update

func (s *Currency) Update(c *model.Currency)

Update updates currency of inmemory storage.

type InmemoryStorage

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

InmemoryStorage is a facade structure which aggregates all inmemory storages. It is used for convenience.

func New

func New() *InmemoryStorage

New returns new InmemoryStorage.

func (*InmemoryStorage) Account

func (s *InmemoryStorage) Account() *Account

Account returns account inmemory storage.

func (*InmemoryStorage) Category

func (s *InmemoryStorage) Category() *Category

Category returns category inmemory storage.

func (*InmemoryStorage) Currency

func (s *InmemoryStorage) Currency() *Currency

Currency returns currency inmemory storage.

func (*InmemoryStorage) Transaction

func (s *InmemoryStorage) Transaction() *Transaction

Transaction returns transaction inmemory storage.

type Transaction

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

Transaction is used to acces inmemory storage.

func NewTransaction

func NewTransaction() *Transaction

NewTransaction returns new transaction inmemory storage.

func (*Transaction) Delete

func (s *Transaction) Delete(t *model.Transaction)

Delete removes transaction from current inmemory storage.

func (*Transaction) GetAll

func (s *Transaction) GetAll() []*model.Transaction

GetAll returns slice of transactions.

func (*Transaction) GetByID

func (s *Transaction) GetByID(id int64) *model.Transaction

GetByID returns transaction by its id.

func (*Transaction) Init

func (s *Transaction) Init(tt []*model.Transaction)

Init initialize inmemory storage with given slice of data.

func (*Transaction) Insert

func (s *Transaction) Insert(t *model.Transaction)

Insert appends transaction to inmemory storage.

func (*Transaction) Update

func (s *Transaction) Update(t *model.Transaction)

Update updates transaction of inmemory storage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳