presenterlisttransactions

package
v0.0.0-...-97d844a Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDataHasOddLength = errors.New("data has odd length")

ErrDataHasOddLength ...

View Source
var ErrNoDataToPresent = errors.New("did not receive data to present")

ErrNoDataToPresent ...

Functions

This section is empty.

Types

type Presenter

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

Presenter repackages transactions into a view model

func NewPresenter

func NewPresenter() (*Presenter, error)

NewPresenter creates a new presenter instance

func (*Presenter) OutputData

func (p *Presenter) OutputData() ([]string, error)

OutputData returns the output data already converted to strings

func (*Presenter) Present

func (p *Presenter) Present(data []map[string]*transaction.Money) error

Present receives data from the interactor and transforms it in data suitable to be sent to the view model.

func (*Presenter) ViewModel

func (p *Presenter) ViewModel() (*ViewModel, error)

ViewModel returns an object with the data to be presented

type ViewModel

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

ViewModel contains data to be shown.

func NewViewModel

func NewViewModel(data []string) (*ViewModel, error)

NewViewModel creates a view model instance

func (*ViewModel) Write

func (vm *ViewModel) Write(view Viewer)

Writes the data into a view

type Viewer

type Viewer interface {
	io.Writer
}

Viewer interface

Jump to

Keyboard shortcuts

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