presenter

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: 6 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 presenter contains logic related to UI.

func NewAccount

func NewAccount(currencyService *service.Currency) *Account

NewAccount returns Account presenter.

func (*Account) FromMap

func (p *Account) FromMap(m map[string]string) (*model.Account, error)

FromMap parses map[string]string to model.Account. It doesn't handles ID field.

func (*Account) ToMap

func (p *Account) ToMap(a *model.Account) map[string]string

ToMap converts model.Account to map[string]string. It doesn't handles ID field.

type Category

type Category struct{}

Category presenter contains logic related to UI.

func NewCategory

func NewCategory() *Category

NewCategory returns Category presenter.

func (*Category) FromMap

func (p *Category) FromMap(m map[string]string) (*model.Category, error)

FromMap parses map[string]string to model.Category. It doesn't handles ID field.

func (*Category) ToMap

func (p *Category) ToMap(c *model.Category) map[string]string

ToMap converts model.Category to map[string]string. It doesn't handles ID field.

type Currency

type Currency struct{}

Currency presenter contains logic related to UI.

func NewCurrency

func NewCurrency() *Currency

NewCurrency returns Currency presenter.

func (*Currency) FromMap

func (p *Currency) FromMap(m map[string]string) (*model.Currency, error)

FromMap parses map[string]string to model.Currency. It doesn't handles ID field.

func (*Currency) ToMap

func (p *Currency) ToMap(c *model.Currency) map[string]string

ToMap converts model.Currency to map[string]string. It doesn't handles ID field.

type Presenter

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

Presenter is a facade structure which aggregates all Presenters. It is used for convenience.

func New

func New(service *service.Service) *Presenter

New returns new Presenter.

func (*Presenter) Account

func (p *Presenter) Account() *Account

Account returns category presenter.

func (*Presenter) Category

func (p *Presenter) Category() *Category

Category returns category presenter.

func (*Presenter) Currency

func (p *Presenter) Currency() *Currency

Currency returns category presenter.

func (*Presenter) Transaction

func (p *Presenter) Transaction() *Transaction

Transaction returns category presenter.

type Transaction

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

Transaction presenter contains logic related to UI.

func NewTransaction

func NewTransaction(accountService *service.Account, categoryService *service.Category) *Transaction

NewTransaction returns Transaction presenter.

func (*Transaction) FromMap

func (p *Transaction) FromMap(m map[string]string) (*model.Transaction, error)

FromMap parses map[string]string to model.Transaction. It doesn't handles ID field.

func (*Transaction) ToMap

func (p *Transaction) ToMap(t *model.Transaction) map[string]string

ToMap converts model.Transaction to map[string]string. It doesn't handles ID field.

Jump to

Keyboard shortcuts

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