config

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SchemaJson string

Functions

func DefaultCurrency

func DefaultCurrency() string

func LoadConfig added in v0.4.1

func LoadConfig(content []byte) error

Types

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 Commodity added in v0.4.1

type Commodity struct {
	Name        string          `json:"name" yaml:"name"`
	Type        CommodityType   `json:"type" yaml:"type"`
	Code        string          `json:"code" yaml:"code"`
	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"
	Unknown    CommodityType = "unknown"
)

type Config

type Config struct {
	JournalPath                string     `json:"journal_path" yaml:"journal_path"`
	DBPath                     string     `json:"db_path" yaml:"db_path"`
	LedgerCli                  string     `json:"ledger_cli" yaml:"ledger_cli"`
	DefaultCurrency            string     `json:"default_currency" yaml:"default_currency"`
	Locale                     string     `json:"locale" yaml:"locale"`
	FinancialYearStartingMonth time.Month `json:"financial_year_starting_month" yaml:"financial_year_starting_month"`

	Retirement Retirement `json:"retirement" yaml:"retirement"`

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

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

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

func GetConfig added in v0.4.1

func GetConfig() Config

type Retirement added in v0.4.1

type Retirement struct {
	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"`
}

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"
)

Jump to

Keyboard shortcuts

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