config

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SchemaJson string

Functions

func DefaultCurrency

func DefaultCurrency() string

func EnsureLogFilePath added in v0.5.1

func EnsureLogFilePath() (string, error)

func GetConfigDir added in v0.5.0

func GetConfigDir() string

func GetConfigPath added in v0.5.0

func GetConfigPath() string

func GetDBPath added in v0.5.3

func GetDBPath() string

func GetJournalPath added in v0.5.3

func GetJournalPath() string

func GetSchema added in v0.5.0

func GetSchema() any

func GetSheetDir added in v0.6.3

func GetSheetDir() string

func LoadConfig added in v0.4.1

func LoadConfig(content []byte, cp string) error

func LoadConfigFile added in v0.5.0

func LoadConfigFile(path string)

func SaveConfig added in v0.5.0

func SaveConfig(content []byte) error

func SaveConfigObject added in v0.5.3

func SaveConfigObject(config Config) error

func TimeZone added in v0.6.5

func TimeZone() *time.Location

Types

type Account added in v0.5.5

type Account struct {
	Name string `json:"name" yaml:"name"`
	Icon string `json:"icon" yaml:"icon"`
}

type AllocationTarget added in v0.4.1

type AllocationTarget struct {
	Name     string   `json:"name" yaml:"name"`
	Target   float64  `json:"target" yaml:"target"`
	Accounts []string `json:"accounts" yaml:"accounts"`
}

type BoolType added in v0.5.6

type BoolType string
const (
	Yes BoolType = "yes"
	No  BoolType = "no"
)

type Budget added in v0.5.6

type Budget struct {
	Rollover BoolType `json:"rollover" yaml:"rollover"`
}

type Commodity added in v0.4.1

type Commodity struct {
	Name        string          `json:"name" yaml:"name"`
	Type        CommodityType   `json:"type" yaml:"type"`
	Price       Price           `json:"price" yaml:"price"`
	Harvest     int             `json:"harvest" yaml:"harvest"`
	TaxCategory TaxCategoryType `json:"tax_category" yaml:"tax_category"`
}

type CommodityType added in v0.4.1

type CommodityType string
const (
	MutualFund CommodityType = "mutualfund"
	NPS        CommodityType = "nps"
	Stock      CommodityType = "stock"
	Metal      CommodityType = "metal"
	Unknown    CommodityType = "unknown"
)

type Config

type Config struct {
	JournalPath                string       `json:"journal_path" yaml:"journal_path"`
	DBPath                     string       `json:"db_path" yaml:"db_path"`
	Readonly                   bool         `json:"readonly" yaml:"readonly"`
	LedgerCli                  string       `json:"ledger_cli" yaml:"ledger_cli"`
	DefaultCurrency            string       `json:"default_currency" yaml:"default_currency"`
	DisplayPrecision           int          `json:"display_precision" yaml:"display_precision"`
	AmountAlignmentColumn      int          `json:"amount_alignment_column" yaml:"amount_alignment_column"`
	Locale                     string       `json:"locale" yaml:"locale"`
	TimeZone                   string       `json:"time_zone" yaml:"time_zone"`
	FinancialYearStartingMonth time.Month   `json:"financial_year_starting_month" yaml:"financial_year_starting_month"`
	WeekStartingDay            time.Weekday `json:"week_starting_day" yaml:"week_starting_day"`
	Strict                     BoolType     `json:"strict" yaml:"strict"`

	Budget Budget `json:"budget" yaml:"budget"`

	ScheduleALs []ScheduleAL `json:"schedule_al" yaml:"schedule_al"`

	AllocationTargets []AllocationTarget `json:"allocation_targets" yaml:"allocation_targets"`

	Commodities []Commodity `json:"commodities" yaml:"commodities"`

	ImportTemplates []ImportTemplate `json:"import_templates" yaml:"import_templates"`

	Accounts []Account `json:"accounts" yaml:"accounts"`

	Goals Goals `json:"goals" yaml:"goals"`

	UserAccounts []UserAccount `json:"user_accounts" yaml:"user_accounts"`

	CreditCards []CreditCard `json:"credit_cards" yaml:"credit_cards"`
}

func GetConfig added in v0.4.1

func GetConfig() Config

type CreditCard added in v0.6.5

type CreditCard struct {
	Account         string `json:"account" yaml:"account"`
	CreditLimit     int    `json:"credit_limit" yaml:"credit_limit"`
	StatementEndDay int    `json:"statement_end_day" yaml:"statement_end_day"`
	DueDay          int    `json:"due_day" yaml:"due_day"`
	Network         string `json:"network" yaml:"network"`
	Number          string `json:"number" yaml:"number"`
	ExpirationDate  string `json:"expiration_date" yaml:"expiration_date"`
}

type Goals added in v0.5.7

type Goals struct {
	Retirement []RetirementGoal `json:"retirement" yaml:"retirement"`
	Savings    []SavingsGoal    `json:"savings" yaml:"savings"`
}

type ImportTemplate added in v0.5.3

type ImportTemplate struct {
	Name    string `json:"name" yaml:"name"`
	Content string `json:"content" yaml:"content"`
}

type Price added in v0.5.1

type Price struct {
	Provider string `json:"provider" yaml:"provider"`
	Code     string `json:"code" yaml:"code"`
}

type RetirementGoal added in v0.5.7

type RetirementGoal struct {
	Name           string   `json:"name" yaml:"name"`
	Icon           string   `json:"icon" yaml:"icon"`
	SWR            float64  `json:"swr" yaml:"swr"`
	Expenses       []string `json:"expenses" yaml:"expenses"`
	Savings        []string `json:"savings" yaml:"savings"`
	YearlyExpenses float64  `json:"yearly_expenses" yaml:"yearly_expenses"`
	Priority       int      `json:"priority" yaml:"priority"`
}

type SavingsGoal added in v0.5.7

type SavingsGoal struct {
	Name             string   `json:"name" yaml:"name"`
	Icon             string   `json:"icon" yaml:"icon"`
	Target           float64  `json:"target" yaml:"target"`
	TargetDate       string   `json:"target_date" yaml:"target_date"`
	Rate             float64  `json:"rate" yaml:"rate"`
	PaymentPerPeriod float64  `json:"payment_per_period" yaml:"payment_per_period"`
	Accounts         []string `json:"accounts" yaml:"accounts"`
	Priority         int      `json:"priority" yaml:"priority"`
}

type ScheduleAL added in v0.4.1

type ScheduleAL struct {
	Code     string   `json:"code" yaml:"code"`
	Accounts []string `json:"accounts" yaml:"accounts"`
}

type TaxCategoryType added in v0.4.1

type TaxCategoryType string
const (
	Debt           TaxCategoryType = "debt"
	Equity         TaxCategoryType = "equity"
	Equity65       TaxCategoryType = "equity65"
	Equity35       TaxCategoryType = "equity35"
	UnlistedEquity TaxCategoryType = "unlisted_equity"
)

type UserAccount added in v0.6.1

type UserAccount struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

Jump to

Keyboard shortcuts

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