Documentation
¶
Overview ¶
Package gnucash allows reading GnuCash v2 XML database and converting it to a coin ledger.
Index ¶
Constants ¶
View Source
const TimeStamp = "2006-01-02 15:04:05 -0700"
TimeStamp is GnuCash time format
Variables ¶
Functions ¶
func AccountFrom ¶
func CommodityFrom ¶
Types ¶
type Account ¶
type Account struct { Guid string `xml:"id"` Name string `xml:"name"` Type string `xml:"type"` CommoditySpace string `xml:"commodity>space"` CommodityId string `xml:"commodity>id"` CommodityScu int `xml:"commodity-scu"` NonStandardScu int `xml:"non-standard-scu,omitempty"` ParentGuid string `xml:"parent"` Code string `xml:"code,omitempty"` Description string `xml:"description,omitempty"` Slots []*KvpSlot `xml:"slots>slot"` }
type Book ¶
type Book struct { Accounts []*Account `xml:"account"` Commodities []*Commodity `xml:"commodity"` Prices []*Price `xml:"pricedb>price"` Transactions []*Transaction `xml:"transaction"` }
type Commodity ¶
type Commodity struct { XMLName xml.Name `xml:"commodity"` Space string `xml:"space"` Id string `xml:"id"` Name string `xml:"name,omitempty"` Code string `xml:"xcode,omitempty"` Fraction int64 `xml:"fraction"` QuoteSource string `xml:"quote_source,omitempty"` QuoteTz string `xml:"quote_tz,omitempty"` Slots []*KvpSlot `xml:"slots>slot"` }
Commodity = element gnc:commodity { attribute version { "2.0.0" }, ( ( element cmdty:space { "ISO4217" }, # catégorie (monnaies) element cmdty:id { text } # dénomination ) | ( element cmdty:space { text }, element cmdty:id { text }, element cmdty:name { text }?, element cmdty:xcode { text }?, element cmdty:fraction { text } ) ), ( element cmdty:get_quotes { empty }, element cmdty:quote_source { text }?, element cmdty:quote_tz { text | empty }? )?, element cmdty:slots { KvpSlot+ }? }
type Price ¶
type Price struct { Guid string `xml:"id"` CommoditySpace string `xml:"commodity>space"` CommodityId string `xml:"commodity>id"` CurrencySpace string `xml:"currency>space"` CurrencyId string `xml:"currency>id"` Date string `xml:"time>date"` Source string `xml:"source,omitempty"` ValueFraction string `xml:"value"` Type string `xml:"type,omitempty"` }
type Split ¶
type Split struct { Guid string `xml:"id"` AccountGuid string `xml:"account"` Memo string `xml:"memo,omitempty"` Action string `xml:"action,omitempty"` ReconciledState string `xml:"reconciled-state"` ReconciledStamp string `xml:"reconcile-date>date,omitempty"` ValueFraction string `xml:"value"` QuantityFraction string `xml:"quantity"` }
type Transaction ¶
type Transaction struct { Guid string `xml:"id"` CurrencySpace string `xml:"currency>space"` CurrencyId string `xml:"currency>id"` Num string `xml:"num,omitempty"` PostedStamp string `xml:"date-posted>date"` EnteredStamp string `xml:"date-entered>date"` Description string `xml:"description,omitempty"` Splits []*Split `xml:"splits>split"` }
Click to show internal directories.
Click to hide internal directories.