parser

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package parser reads the four-field FYT user timesheet format. It validates individual entries; duplicate and overlap policies belong to subsequent processing of the complete input set.

Index

Constants

This section is empty.

Variables

View Source
var ErrParse = errors.New("could not parse timesheet")

ErrParse identifies invalid timesheet input or a failure to read it.

Functions

func Parse

func Parse(r io.Reader) ([]*v1alpha1.TimeEntry, error)

Parse reads entries in source order using the local timezone. Blank lines and full-line comments beginning with "#:" are ignored. Records occupy one physical line; quoted fields use doubled quotes, with no backslash escaping. Ticket and description whitespace is preserved. Independent line errors are collected, and any error returns a nil result rather than partial entries.

func ParseFile

func ParseFile(path string) ([]*v1alpha1.TimeEntry, error)

ParseFile opens a timesheet and includes its path in any returned error.

Types

type Error

type Error struct {
	Line  int
	Field string
	Value string
	Err   error
}

Error describes a problem at a one-based physical line in the input. Field is a record field name, "record" for structural errors, or "input" for reader errors. Value preserves the problematic source value. ParseFile includes the source path in the enclosing error.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap exposes the underlying parse or reader error.

Jump to

Keyboard shortcuts

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