bank

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokensPerTransaction is the amount of tokens per Transaction
	TokensPerTransaction = 21

	// DateToken is the Token that contains the Date
	DateToken = 1

	// PayeeToken is the Token that contains the Payee
	PayeeToken = 13

	// AmountToken is the Token that contains the Amount
	AmountToken = 19

	// AmountMultiplier is the multiplier to match a Transactions int format
	AmountMultiplier = 1000
)
View Source
const (
	// SHB is Svenska Handelsbanken
	SHB = "shb"
	// SEB is Skandinaviska Enskilda Banken
	SEB = "seb"
	// NORDEA is Nordea Bank
	NORDEA = "nordea"
	// SWEDBANK is Swedbank
	SWEDBANK = "swedbank"
)

Variables

View Source
var (
	// ErrNoFileOrDir is returned when no filename or dir is specified
	ErrNoFileOrDir = errors.New("filename or dir must be specified")
)
View Source
var (
	// ErrParserNotFound is returned when no parser is found
	ErrParserNotFound = errors.New("parser not found")
)

Functions

This section is empty.

Types

type Handelsbanken

type Handelsbanken struct {
}

Handelsbanken is the File Parser implementations for Handelsbanken .xls files

func (*Handelsbanken) Bank

func (h *Handelsbanken) Bank() string

Bank returns the name of the bank

func (*Handelsbanken) ReadFile

func (h *Handelsbanken) ReadFile(b []byte) ([]*budget.Transaction, error)

ReadFile parsers the file and extracts transactions

type Importer

type Importer interface {
	Import(filename, path, bank string) ([]*budget.Transaction, error)
}

Importer is an importer of bank transaction statements

func New

func New(parsers Parsers) Importer

New returns a new Importer

type Parser

type Parser interface {
	ReadFile(b []byte) ([]*budget.Transaction, error)
	Bank() string
}

Parser is a parser of bank transaction statements

type Parsers

type Parsers map[string]Parser

Parsers is a wrapper for a map of parsers

var ImplementedParsers Parsers = map[string]Parser{SHB: &Handelsbanken{}}

ImplementedParsers is the map of implemented parsers

func (Parsers) Find

func (p Parsers) Find(bank string) (Parser, error)

Find a bank parsers by bank name

Jump to

Keyboard shortcuts

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