datatable

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 4 Imported by: 19

Documentation

Index

Constants

View Source
const TRANSACTION_DATA_TABLE_TIMEZONE_NOT_AVAILABLE = "TIMEZONE_NOT_AVAILABLE"

TRANSACTION_DATA_TABLE_TIMEZONE_NOT_AVAILABLE represents the constant for timezone not available

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicDataTable added in v0.10.0

type BasicDataTable interface {
	// DataRowCount returns the total count of data row
	DataRowCount() int

	// HeaderColumnNames returns the header column name list
	HeaderColumnNames() []string

	// DataRowIterator returns the iterator of data row
	DataRowIterator() BasicDataTableRowIterator
}

BasicDataTable defines the structure of basic data table

type BasicDataTableRow added in v0.10.0

type BasicDataTableRow interface {
	// ColumnCount returns the total count of column in this data row
	ColumnCount() int

	// GetData returns the data in the specified column index
	GetData(columnIndex int) string
}

BasicDataTableRow defines the structure of basic data row

type BasicDataTableRowIterator added in v0.10.0

type BasicDataTableRowIterator interface {
	// HasNext returns whether the iterator does not reach the end
	HasNext() bool

	// CurrentRowId returns current row id
	CurrentRowId() string

	// Next returns the next basic data row
	Next() BasicDataTableRow
}

BasicDataTableRowIterator defines the structure of basic data row iterator

type CommonDataTable

type CommonDataTable interface {
	// HeaderColumnCount returns the total count of column in header row
	HeaderColumnCount() int

	// HasColumn returns whether the common data table has specified column name
	HasColumn(columnName string) bool

	// DataRowCount returns the total count of common data row
	DataRowCount() int

	// DataRowIterator returns the iterator of common data row
	DataRowIterator() CommonDataTableRowIterator
}

CommonDataTable defines the structure of common data table

func CreateNewCommonDataTableFromBasicDataTable added in v0.10.0

func CreateNewCommonDataTableFromBasicDataTable(dataTable BasicDataTable) CommonDataTable

CreateNewCommonDataTableFromBasicDataTable returns common data table from basic data table

type CommonDataTableRow added in v0.10.0

type CommonDataTableRow interface {
	// ColumnCount returns the total count of column in this data row
	ColumnCount() int

	// HasData returns whether the common data row has specified column data
	HasData(columnName string) bool

	// GetData returns the data in the specified column name
	GetData(columnName string) string
}

CommonDataTableRow defines the structure of common data row

type CommonDataTableRowIterator added in v0.10.0

type CommonDataTableRowIterator interface {
	// HasNext returns whether the iterator does not reach the end
	HasNext() bool

	// CurrentRowId returns current row id
	CurrentRowId() string

	// Next returns the next common data row
	Next() CommonDataTableRow
}

CommonDataTableRowIterator defines the structure of common data row iterator

type CommonTransactionDataRowParser

type CommonTransactionDataRowParser interface {
	// Parse returns the converted transaction data row
	Parse(ctx core.Context, user *models.User, dataRow CommonDataTableRow, rowId string) (rowData map[TransactionDataTableColumn]string, rowDataValid bool, err error)
}

CommonTransactionDataRowParser defines the structure of common transaction data row parser

type SubBasicDataTable added in v1.0.0

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

SubBasicDataTable defines the structure of sub basic data table

func CreateSubBasicTable added in v1.0.0

func CreateSubBasicTable(dataTable BasicDataTable, fromIndex, toIndex int) *SubBasicDataTable

CreateSubBasicTable returns a sub basic data table that references a portion of the original table

func (*SubBasicDataTable) DataRowCount added in v1.0.0

func (t *SubBasicDataTable) DataRowCount() int

DataRowCount returns the total count of data row

func (*SubBasicDataTable) DataRowIterator added in v1.0.0

func (t *SubBasicDataTable) DataRowIterator() BasicDataTableRowIterator

DataRowIterator returns the iterator of data row

func (*SubBasicDataTable) HeaderColumnNames added in v1.0.0

func (t *SubBasicDataTable) HeaderColumnNames() []string

HeaderColumnNames returns the header column name list

type SubBasicDataTableRowIterator added in v1.0.0

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

SubBasicDataTableRowIterator defines the structure of sub basic data table row iterator

func (*SubBasicDataTableRowIterator) CurrentRowId added in v1.0.0

func (t *SubBasicDataTableRowIterator) CurrentRowId() string

CurrentRowId returns current row id

func (*SubBasicDataTableRowIterator) HasNext added in v1.0.0

func (t *SubBasicDataTableRowIterator) HasNext() bool

HasNext returns whether the iterator does not reach the end

func (*SubBasicDataTableRowIterator) Next added in v1.0.0

Next returns the next basic data row

type TransactionDataRow

type TransactionDataRow interface {
	// IsValid returns whether this row is valid data for importing
	IsValid() bool

	// GetData returns the data in the specified column type
	GetData(column TransactionDataTableColumn) string
}

TransactionDataRow defines the structure of transaction data row

type TransactionDataRowIterator

type TransactionDataRowIterator interface {
	// HasNext returns whether the iterator does not reach the end
	HasNext() bool

	// Next returns the next transaction data row
	Next(ctx core.Context, user *models.User) (daraRow TransactionDataRow, err error)
}

TransactionDataRowIterator defines the structure of transaction data row iterator

type TransactionDataRowParser

type TransactionDataRowParser interface {
	// GetAddedColumns returns the added columns after converting the data row
	GetAddedColumns() []TransactionDataTableColumn

	// Parse returns the converted transaction data row
	Parse(data map[TransactionDataTableColumn]string) (rowData map[TransactionDataTableColumn]string, rowDataValid bool, err error)
}

TransactionDataRowParser defines the structure of transaction data row parser

type TransactionDataTable

type TransactionDataTable interface {
	// HasColumn returns whether the transaction data table has specified column
	HasColumn(column TransactionDataTableColumn) bool

	// TransactionRowCount returns the total count of transaction data row
	TransactionRowCount() int

	// TransactionRowIterator returns the iterator of transaction data row
	TransactionRowIterator() TransactionDataRowIterator
}

TransactionDataTable defines the structure of transaction data table

func CreateNewTransactionDataTableFromBasicDataTable added in v0.10.0

func CreateNewTransactionDataTableFromBasicDataTable(dataTable BasicDataTable, dataColumnMapping map[TransactionDataTableColumn]string) TransactionDataTable

CreateNewTransactionDataTableFromBasicDataTable returns transaction data table from basic data table

func CreateNewTransactionDataTableFromBasicDataTableWithRowParser added in v0.10.0

func CreateNewTransactionDataTableFromBasicDataTableWithRowParser(dataTable BasicDataTable, dataColumnMapping map[TransactionDataTableColumn]string, rowParser TransactionDataRowParser) TransactionDataTable

CreateNewTransactionDataTableFromBasicDataTableWithRowParser returns transaction data table from basic data table

func CreateNewTransactionDataTableFromCommonDataTable added in v0.10.0

func CreateNewTransactionDataTableFromCommonDataTable(dataTable CommonDataTable, supportedDataColumns map[TransactionDataTableColumn]bool, rowParser CommonTransactionDataRowParser) TransactionDataTable

CreateNewTransactionDataTableFromCommonDataTable returns transaction data table from Common data table

type TransactionDataTableBuilder

type TransactionDataTableBuilder interface {
	// AppendTransaction appends the specified transaction to data builder
	AppendTransaction(data map[TransactionDataTableColumn]string)

	// ReplaceDelimiters returns the text after removing the delimiters
	ReplaceDelimiters(text string) string
}

TransactionDataTableBuilder defines the structure of data table builder

type TransactionDataTableColumn

type TransactionDataTableColumn byte

TransactionDataTableColumn represents the data column type of data table

const (
	TRANSACTION_DATA_TABLE_TRANSACTION_TIME         TransactionDataTableColumn = 1
	TRANSACTION_DATA_TABLE_TRANSACTION_TIMEZONE     TransactionDataTableColumn = 2
	TRANSACTION_DATA_TABLE_TRANSACTION_TYPE         TransactionDataTableColumn = 3
	TRANSACTION_DATA_TABLE_CATEGORY                 TransactionDataTableColumn = 4
	TRANSACTION_DATA_TABLE_SUB_CATEGORY             TransactionDataTableColumn = 5
	TRANSACTION_DATA_TABLE_ACCOUNT_NAME             TransactionDataTableColumn = 6
	TRANSACTION_DATA_TABLE_ACCOUNT_CURRENCY         TransactionDataTableColumn = 7
	TRANSACTION_DATA_TABLE_AMOUNT                   TransactionDataTableColumn = 8
	TRANSACTION_DATA_TABLE_RELATED_ACCOUNT_NAME     TransactionDataTableColumn = 9
	TRANSACTION_DATA_TABLE_RELATED_ACCOUNT_CURRENCY TransactionDataTableColumn = 10
	TRANSACTION_DATA_TABLE_RELATED_AMOUNT           TransactionDataTableColumn = 11
	TRANSACTION_DATA_TABLE_GEOGRAPHIC_LOCATION      TransactionDataTableColumn = 12
	TRANSACTION_DATA_TABLE_TAGS                     TransactionDataTableColumn = 13
	TRANSACTION_DATA_TABLE_DESCRIPTION              TransactionDataTableColumn = 14
	TRANSACTION_DATA_TABLE_PAYEE                    TransactionDataTableColumn = 101
	TRANSACTION_DATA_TABLE_MEMBER                   TransactionDataTableColumn = 102
	TRANSACTION_DATA_TABLE_PROJECT                  TransactionDataTableColumn = 103
	TRANSACTION_DATA_TABLE_MERCHANT                 TransactionDataTableColumn = 104
)

Transaction data table columns

type WritableTransactionDataRow

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

WritableTransactionDataRow defines the structure of transaction data row of writable data table

func (*WritableTransactionDataRow) ColumnCount

func (r *WritableTransactionDataRow) ColumnCount() int

ColumnCount returns the total count of column in this data row

func (*WritableTransactionDataRow) GetData

GetData returns the data in the specified column type

func (*WritableTransactionDataRow) IsValid

func (r *WritableTransactionDataRow) IsValid() bool

IsValid returns whether this row is valid data for importing

type WritableTransactionDataRowIterator

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

WritableTransactionDataRowIterator defines the structure of transaction data row iterator of writable data table

func (*WritableTransactionDataRowIterator) HasNext

HasNext returns whether the iterator does not reach the end

func (*WritableTransactionDataRowIterator) Next

Next returns the next transaction data row

type WritableTransactionDataTable

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

WritableTransactionDataTable defines the structure of writable transaction data table

func CreateNewWritableTransactionDataTable

func CreateNewWritableTransactionDataTable(columns []TransactionDataTableColumn) *WritableTransactionDataTable

CreateNewWritableTransactionDataTable returns a new writable transaction data table according to the specified columns

func CreateNewWritableTransactionDataTableWithRowParser

func CreateNewWritableTransactionDataTableWithRowParser(columns []TransactionDataTableColumn, rowParser TransactionDataRowParser) *WritableTransactionDataTable

CreateNewWritableTransactionDataTableWithRowParser returns a new writable transaction data table according to the specified columns

func (*WritableTransactionDataTable) Add

Add appends a new record to data table

func (*WritableTransactionDataTable) Get

Get returns the record in the specified index

func (*WritableTransactionDataTable) HasColumn

HasColumn returns whether the data table has specified column

func (*WritableTransactionDataTable) TransactionRowCount

func (t *WritableTransactionDataTable) TransactionRowCount() int

TransactionRowCount returns the total count of transaction data row

func (*WritableTransactionDataTable) TransactionRowIterator

func (t *WritableTransactionDataTable) TransactionRowIterator() TransactionDataRowIterator

TransactionRowIterator returns the iterator of transaction data row

Jump to

Keyboard shortcuts

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