utils

package
v0.5.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BTreeDescendFirstLessOrEqual

func BTreeDescendFirstLessOrEqual[I btree.Item](tree *btree.BTree, item I) I

func BTreeToSlice added in v0.3.5

func BTreeToSlice[I btree.Item](tree *btree.BTree) []I

func BeginningOfFinancialYear added in v0.1.3

func BeginningOfFinancialYear(date time.Time) time.Time

func BeginningOfMonth added in v0.1.3

func BeginningOfMonth(date time.Time) time.Time

func EndOfDay added in v0.5.2

func EndOfDay(date time.Time) time.Time

func EndOfFinancialYear added in v0.1.3

func EndOfFinancialYear(date time.Time) time.Time

func EndOfMonth added in v0.1.3

func EndOfMonth(date time.Time) time.Time

func EndOfToday added in v0.5.2

func EndOfToday() time.Time

func Exec added in v0.5.0

func Exec(name string, stdout *bytes.Buffer, stderr *bytes.Buffer, args ...string) error

func FY added in v0.2.2

func FY(date time.Time) string

func FYHuman added in v0.3.1

func FYHuman(date time.Time) string

func FileExists added in v0.5.0

func FileExists(path string) bool

func GroupByAccount added in v0.4.8

func GroupByAccount(posts []posting.Posting) map[string][]posting.Posting

func GroupByFY added in v0.4.5

func GroupByFY[G GroupableByDate](groupables []G) map[string][]G

func GroupByMonth added in v0.4.5

func GroupByMonth[G GroupableByDate](groupables []G) map[string][]G

func IsCheckingAccount added in v0.4.8

func IsCheckingAccount(account string) bool

func IsCurrency added in v0.3.7

func IsCurrency(currency string) bool

func IsExpenseInterestAccount added in v0.5.2

func IsExpenseInterestAccount(account string) bool

func IsSameOrParent added in v0.2.4

func IsSameOrParent(account string, comparison string) bool

func IsWithDate added in v0.1.5

func IsWithDate(date time.Time, start time.Time, end time.Time) bool

func MaxTime added in v0.4.2

func MaxTime(a time.Time, b time.Time) time.Time

func Now added in v0.5.2

func Now() time.Time

func OpenDB added in v0.5.1

func OpenDB() (*gorm.DB, error)

func SetNow added in v0.5.2

func SetNow(date string)

func SortedKeys added in v0.4.8

func SortedKeys[K constraints.Ordered, V any](m map[K]V) []K

func SumBy added in v0.4.8

func SumBy[C any](collection []C, iteratee func(item C) decimal.Decimal) decimal.Decimal

func UnQuote added in v0.5.0

func UnQuote(str string) string

Types

type GroupableByDate added in v0.4.5

type GroupableByDate interface {
	GroupDate() time.Time
}

Jump to

Keyboard shortcuts

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