budget

package
v0.0.0-...-f6bd952 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(amount int, freq Frequency, name, description string, kind ItemKind) error

func Show

func Show() error

Types

type Budget

type Budget struct {
	Items        []Item
	CreationDate time.Time
	LastEdited   time.Time
}

func New

func New() Budget

New creates a new named budget struct.

type Frequency

type Frequency int
const (
	Yearly  Frequency = 1
	Monthly Frequency = 12
	Weekly  Frequency = 52
	Daily   Frequency = 365
	Once    Frequency = 0 // this might have to be one same as yearly? and rely on repeat flag for calculations.

)

func ParseFrequencyStr

func ParseFrequencyStr(str string) (Frequency, bool)

func (Frequency) String

func (f Frequency) String() string

type Item

type Item struct {
	Amount      int
	Frequency   Frequency
	Name        string
	Description string
	Kind        ItemKind
}

func (Item) String

func (i Item) String() string

type ItemKind

type ItemKind string
const (
	Expense ItemKind = "expense"
	Income  ItemKind = "income"
)

Jump to

Keyboard shortcuts

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