Versions in this module Expand all Collapse all v1 v1.0.0 Nov 18, 2025 Changes in this version + func Install(ctx context.Context, opts *InstallHledgerOption) (string, error) + func IsInstalled() (string, bool) + type AccountType string + const AccountTypeAsset + const AccountTypeCash + const AccountTypeConversion + const AccountTypeEquity + const AccountTypeExpense + const AccountTypeLiability + const AccountTypeRevenue + type Command struct + func (c *Command) Run(ctx context.Context) ([]byte, error) + func (c *Command) Stream(ctx context.Context, w io.Writer) error + func (c *Command) String() string + type CommandError struct + Command string + Err error + Stderr string + func (e *CommandError) Error() string + func (e *CommandError) Unwrap() error + type Hledger struct + Binary string + DefaultArgs []Option + JournalPaths []string + func New(opts *NewHledgerOption) (*Hledger, error) + func (client *Hledger) NewCommand(command string, options ...Option) *Command + func (hl *Hledger) Version(ctx context.Context) (string, error) + type InstallHledgerOption struct + Dir string + LogLevel slog.Level + Logger *slog.Logger + Version string + type NewHledgerOption struct + BinaryPath string + DefaultArgs []Option + LedgerPaths []string + type Option func(*Command) + func WithAccount(account ...string) Option + func WithAccountTypes(acctTypes ...AccountType) Option + func WithAlias(a, b string) Option + func WithArg(arg ...string) Option + func WithAuto() Option + func WithAverage() Option + func WithBudget(descPattern ...string) Option + func WithCommodityStyle(style string) Option + func WithCost() Option + func WithCount() Option + func WithCumulative() Option + func WithDate(dateStr string) Option + func WithDeclared() Option + func WithDepth(level int, filter string) Option + func WithDrop(n int) Option + func WithEmpty() Option + func WithForecast(period ...string) Option + func WithFormat(format string) Option + func WithHistorical() Option + func WithIgnoreAssertions() Option + func WithInferMarketPrice() Option + func WithInvert() Option + func WithNoTotal() Option + func WithNotQuery(queryType QueryType, value string) Option + func WithOutputType(outputType OutputType) Option + func WithPercent() Option + func WithPeriod(p PeriodType) Option + func WithPivot(tagName string) Option + func WithPretty() Option + func WithQuery(queryType QueryType, value string) Option + func WithRowTotal() Option + func WithSortAmount() Option + func WithStatus(trStatus TrStatusType) Option + func WithStrict() Option + func WithToday(date string) Option + func WithTree() Option + func WithTxnBalancing(balancingType TxnBalancingType) Option + func WithValuation(commodity string, valType ValuationType) Option + func WithValueChange() Option + type OutputType string + const OutputCSV + const OutputFODS + const OutputHTML + const OutputJSON + const OutputTSV + const OutputTXT + type PeriodType string + const PeriodDaily + const PeriodMonthly + const PeriodQuarterly + const PeriodWeekly + const PeriodYearly + func NewCmdPeriod(periodStr string) PeriodType + type QueryType string + const QueryTypeAcct + const QueryTypeAmt + const QueryTypeCode + const QueryTypeCur + const QueryTypeDate2 + const QueryTypeDesc + const QueryTypeNote + const QueryTypePayee + const QueryTypeReal + const QueryTypeTag + type TrStatusType string + const TrStatusCleared + const TrStatusPending + const TrStatusUnmarked + type TxnBalancingType string + const TxnBalancingExact + const TxnBalancingOld + type ValuationType string + const ValuationEnd + const ValuationNow + const ValuationThen