ocli

package
v0.0.0-...-a480952 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateManualAccount

func CreateManualAccount(input []string) *omoney.Account

func CreateManualTransaction

func CreateManualTransaction(input []string) *omoney.Transaction

func ListTransactions

func ListTransactions(input []string, model *omoney.Model, workingIndex int) []omoney.Transaction

example input: [ls <account> -n 20 -l]

return the list of transactions printed, for the working list

func LoadModelFromDB

func LoadModelFromDB(dataDir string) (*omoney.Model, error)

func ParseTokensToFlags

func ParseTokensToFlags(tokens []string, flagMap map[string]int) (map[string][]string, error)

format of flagMap is {<flag>: <number of arguments for flag>}

func ReadCsv

func ReadCsv(filepath string, existingAccounts map[string]string) []*omoney.Transaction

Given the path to a csv file, and the map existingAccounts of alias -> id, interactively parse the csv file into a slice of transaction structs

func ShowTransactions

func ShowTransactions(trs []omoney.Transaction, invert bool, workingIndex int)

workingIndex: the current length of the workinglist, so that new wid's can be printed

Types

type LinkTmplData

type LinkTmplData struct {
	LinkToken string
}

type Linker

type Linker struct {
	Results       chan string
	RelinkResults chan bool
	Errors        chan error
	Client        *plaid.APIClient
	// contains filtered or unexported fields
}

func NewLinker

func NewLinker(client *plaid.APIClient, countries []string, lang string) *Linker
func (l *Linker) Link(port string) (*TokenPair, error)

type LogLevel

type LogLevel int
const (
	Disable LogLevel = iota
	Debug
	DebugDetail
	DebugMinuteDetail
)

type OLogger

type OLogger struct {
	Level LogLevel
}

func NewOLogger

func NewOLogger(level LogLevel) *OLogger

func (*OLogger) Print

func (l *OLogger) Print(level LogLevel, v ...any)

func (*OLogger) Printf

func (l *OLogger) Printf(level LogLevel, format string, v ...any)

func (*OLogger) Println

func (l *OLogger) Println(level LogLevel, v ...any)

type OView

type OView interface {
	ShowAccount(account plaid.AccountBase)
	ShowAccounts(accounts []plaid.AccountBase)
}

type OViewPlain

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

func NewOViewPlain

func NewOViewPlain(enableColor bool) *OViewPlain

func (*OViewPlain) ShowAccount

func (v *OViewPlain) ShowAccount(acc omoney.Account)

func (*OViewPlain) ShowAccounts

func (v *OViewPlain) ShowAccounts(model *omoney.Model, ops ...ShowAccountOptions)

func (*OViewPlain) ShowPlaidAccount

func (v *OViewPlain) ShowPlaidAccount(account plaid.AccountBase)

func (*OViewPlain) ShowPlaidAccounts

func (v *OViewPlain) ShowPlaidAccounts(accounts []plaid.AccountBase)

func (*OViewPlain) ShowTransaction

func (v *OViewPlain) ShowTransaction(tr omoney.Transaction, ops ...ShowTransactionOptions)

type ShowAccountOptions

type ShowAccountOptions struct {
	ShowType   bool
	ShowAnchor bool
	ShowId     bool
}

type ShowTransactionOptions

type ShowTransactionOptions struct {
	ShowId       bool
	ShowCategory bool
	ShowInstDesc bool
	ShowDesc     bool
}

type TokenPair

type TokenPair struct {
	ItemID      string
	AccessToken string
}

Jump to

Keyboard shortcuts

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