Documentation
¶
Index ¶
- type Account
- func (s *Account) Delete(a *model.Account)
- func (s *Account) GetAll() []*model.Account
- func (s *Account) GetByID(id int64) *model.Account
- func (s *Account) GetByName(name string) *model.Account
- func (s *Account) Init(aa []*model.Account)
- func (s *Account) Insert(a *model.Account)
- func (s *Account) Update(a *model.Account)
- type Category
- func (s *Category) Delete(c *model.Category)
- func (s *Category) GetAll() []*model.Category
- func (s *Category) GetByID(id int64) *model.Category
- func (s *Category) GetByTitle(title string) *model.Category
- func (s *Category) Init(cc []*model.Category)
- func (s *Category) Insert(c *model.Category)
- func (s *Category) Update(c *model.Category)
- type Currency
- func (s *Currency) Delete(c *model.Currency)
- func (s *Currency) GetAll() []*model.Currency
- func (s *Currency) GetByAbbreviation(abbreviation string) *model.Currency
- func (s *Currency) GetByID(id int64) *model.Currency
- func (s *Currency) Init(cc []*model.Currency)
- func (s *Currency) Insert(c *model.Currency)
- func (s *Currency) Update(c *model.Currency)
- type InmemoryStorage
- type Transaction
- func (s *Transaction) Delete(t *model.Transaction)
- func (s *Transaction) GetAll() []*model.Transaction
- func (s *Transaction) GetByID(id int64) *model.Transaction
- func (s *Transaction) Init(tt []*model.Transaction)
- func (s *Transaction) Insert(t *model.Transaction)
- func (s *Transaction) Update(t *model.Transaction)
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.
type Category ¶
type Category struct {
// contains filtered or unexported fields
}
Category is used to acces inmemory storage.
func (*Category) GetByTitle ¶
GetByID returns category by its title.
type Currency ¶
type Currency struct {
// contains filtered or unexported fields
}
Currency is used to acces inmemory storage.
func (*Currency) GetByAbbreviation ¶
GetByAbbreviation returns currency by its abbreviation.
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 (*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.