read

package
v0.0.0-...-8710645 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVReader

type CSVReader struct{}

func (*CSVReader) Read

func (r *CSVReader) Read(fileName string, readHeaders bool) ([][]string, error)

type CardTransactions

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

func NewCardTransactions

func NewCardTransactions(data [][]string, columnMapper *ColMapper, rowSubSetter *RowSubSetter, dateLayout string) *CardTransactions

func NewTestCardTransactions

func NewTestCardTransactions(t *testing.T, fixturePath string) *CardTransactions

func (*CardTransactions) Transactions

func (t *CardTransactions) Transactions() ([]Transaction, error)

type ColMapper

type ColMapper struct {
	Date        uint32
	Description uint32
	Credit      uint32 `mapstructure:",omitempty"`
	Refund      uint32 `mapstructure:",omitempty"`
	Balance     uint32 `mapstructure:",omitempty"`
}

type Reader

type Reader interface {
	Read(string, bool) ([][]string, error)
}

func ReaderFactory

func ReaderFactory(fileExtension string) (Reader, error)

type RowSubSetter

type RowSubSetter struct {
	Start uint32
	End   uint32
}

type Transaction

type Transaction struct {
	Date        time.Time
	Description string
	Credit      float64
	Refund      float64
	Balance     float64
}

func NewTestTransaction

func NewTestTransaction(t *testing.T, description string) *Transaction

type XLSXReader

type XLSXReader struct{}

func (*XLSXReader) Read

func (r *XLSXReader) Read(filePath string, _ bool) ([][]string, error)

Jump to

Keyboard shortcuts

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