include

package
v0.0.0-...-8798748 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPathTraversal = errors.New("path traversal detected")
)

Functions

func ConvertHledgerGlob

func ConvertHledgerGlob(pattern string) string

func IsGlobPattern

func IsGlobPattern(path string) bool

func ResolvePath

func ResolvePath(basePath, includePath string) string

func ResolvePathSafe

func ResolvePathSafe(basePath, includePath string) (string, error)

Types

type ErrorKind

type ErrorKind int
const (
	ErrorFileNotFound ErrorKind = iota
	ErrorCycleDetected
	ErrorParseError
	ErrorReadError
	ErrorFileTooLarge
	ErrorPathTraversal
)

type FileSource

type FileSource struct {
	Path    string
	Content string
}

type Limits

type Limits struct {
	MaxFileSizeBytes int64
	MaxIncludeDepth  int
}

func DefaultLimits

func DefaultLimits() Limits

type LoadError

type LoadError struct {
	Kind    ErrorKind
	Path    string
	Message string
	Range   ast.Range
}

func (LoadError) Error

func (e LoadError) Error() string

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader() *Loader

func (*Loader) ClearCache

func (l *Loader) ClearCache()

func (*Loader) InvalidateFile

func (l *Loader) InvalidateFile(path string)

func (*Loader) Load

func (l *Loader) Load(path string) (*ResolvedJournal, []LoadError)

func (*Loader) LoadFromContent

func (l *Loader) LoadFromContent(path, content string) (*ResolvedJournal, []LoadError)

func (*Loader) SetLimits

func (l *Loader) SetLimits(limits Limits)

type ResolvedJournal

type ResolvedJournal struct {
	Primary *ast.Journal
	Files   map[string]*ast.Journal
	Errors  []LoadError
}

func NewResolvedJournal

func NewResolvedJournal(primary *ast.Journal) *ResolvedJournal

func (*ResolvedJournal) AllDirectives

func (r *ResolvedJournal) AllDirectives() []ast.Directive

func (*ResolvedJournal) AllIncludes

func (r *ResolvedJournal) AllIncludes() []ast.Include

func (*ResolvedJournal) AllTransactions

func (r *ResolvedJournal) AllTransactions() []ast.Transaction

Jump to

Keyboard shortcuts

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