cmd

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// names of fields
	NameItem     = "item"
	NameCost     = "cost"
	NameLocation = "location"
	NameCategory = "category"
	NameSource   = "source"
	NameNotes    = "notes"
	NameDate     = "date"

	// prompt questions
	PromptItem      = "What did you buy?"
	PromptCost      = "Cost?"
	PromptLocation  = "Where did you buy this?"
	PromptCategory  = "Please select the item's categories"
	PromptSource    = "Source of Funds?"
	PromptNotes     = "Any notes?"
	PromptDate      = "Transaction date"
	PromptOtherDate = "Enter the date"

	// date options
	DateToday     = "Today"
	DateYesterday = "Yesterday"
	DateDayBefore = "Day before"
	DateOther     = "Other"

	DateFormat = "2006/01/02"
)

Variables

View Source
var Version = "devel"

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetTransactionDate

func GetTransactionDate(inputDate string) string

Types

type Answer

type Answer struct {
	Item     string
	Cost     float64
	Location string
	Category string
	Source   string
	Notes    string
	Date     string
}

type Configuration

type Configuration struct {
	DbName        string   `mapstructure:"dbName"`
	DisableDb     bool     `mapstructure:"disableDb"`
	CsvName       string   `mapstructure:"csvName"`
	DisableCSV    bool     `mapstructure:"disableCSV"`
	Categories    []string `mapstructure:"categories"`
	Funds         []string `mapstructure:"funds"`
	DisableResult bool     `mapstructure:"disableResult"`
}

type TransactionInfo

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

func (*TransactionInfo) FormatAsString

func (t *TransactionInfo) FormatAsString() []string

func (*TransactionInfo) RenderTransactionTable

func (t *TransactionInfo) RenderTransactionTable()

func (*TransactionInfo) WriteTransactionToCSV

func (t *TransactionInfo) WriteTransactionToCSV(file *os.File)

func (*TransactionInfo) WriteTransactionToDB

func (t *TransactionInfo) WriteTransactionToDB(database *sql.DB)

Jump to

Keyboard shortcuts

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