source

package
v0.0.0-...-5a71971 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VenmoDateFormat = "2006-01-02T15:04:05"
	VenmoSourceType = "VENMO"
)
View Source
const (
	ChaseDateFormat = "01/02/2006"
)

Variables

View Source
var (
	FilePattern = regexp.MustCompile("transaction_history.*")
	CSVSource   = csv.Source{
		SourceName: "Venmo",
		Columns: csv.ColumnFormat{
			ID:     2,
			Date:   3,
			Type:   4,
			Memo:   6,
			Person: 7,
			Value:  9,
		},
		DateFormat: VenmoDateFormat,
		HeaderRows: 4,
		FooterRows: 1,
		GenerateID: generateVenmoID,
	}
)

Functions

func AddChaseSource

func AddChaseSource(cs ChaseSource) error

func AddVenmoSource

func AddVenmoSource(vs VenmoSource) error

func EditChaseSource

func EditChaseSource(originalName string, cs ChaseSource) error

func EditVenmoSource

func EditVenmoSource(originalName string, vs VenmoSource) error

func GenerateSourceID

func GenerateSourceID(entry ledger.Entry) string

Types

type ChaseSource

type ChaseSource struct {
	SourceName  string   `yaml:"name"`
	Directories []string `yaml:"directories"`
	LastDigits  string   `yaml:"last_four_digits"`
	AccountType string   `yaml:"account_type"`
	// contains filtered or unexported fields
}

func (*ChaseSource) GetLedgerEntries

func (s *ChaseSource) GetLedgerEntries(year int) ([]ledger.Entry, error)

func (*ChaseSource) Name

func (s *ChaseSource) Name() string

func (*ChaseSource) Type

func (s *ChaseSource) Type() ledger.SourceType

func (*ChaseSource) UnmarshalYAML

func (s *ChaseSource) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*ChaseSource) Validate

func (s *ChaseSource) Validate() error

type Sources

type Sources struct {
	Chase []ChaseSource `yaml:"chase"`
	Venmo []VenmoSource `yaml:"venmo"`
}

func Get

func Get() (*Sources, error)

func (*Sources) List

func (s *Sources) List() []ledger.Source

func (*Sources) Validate

func (s *Sources) Validate() error

type VenmoSource

type VenmoSource struct {
	SourceName        string   `yaml:"name"`
	AccountHolderName string   `yaml:"account_holder_name"`
	Directories       []string `yaml:"directories"`
	HideTransfers     bool     `yaml:"hide_transfers"`
	// contains filtered or unexported fields
}

func (*VenmoSource) GetLedgerEntries

func (s *VenmoSource) GetLedgerEntries(year int) ([]ledger.Entry, error)

func (*VenmoSource) Name

func (s *VenmoSource) Name() string

func (*VenmoSource) Type

func (s *VenmoSource) Type() ledger.SourceType

func (*VenmoSource) UnmarshalYAML

func (s *VenmoSource) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*VenmoSource) Validate

func (s *VenmoSource) Validate() error

Jump to

Keyboard shortcuts

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