umi

package
v0.0.0-...-0ff7613 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBaselineDate = time.Date(2023, 1, 13, 0, 0, 0, 0, time.UTC)

DefaultBaselineDate represents the first date of the first report: 2023-01-13 This is the reference date to calculate the bi-weekly ranges (used in report number etc.)

Functions

func DiscoverReportNumber

func DiscoverReportNumber(forDate time.Time) int

DiscoverReportNumber returns the report number for a given date.

func WeekOfTheYear

func WeekOfTheYear(date time.Time) int

WeekOfTheYear returns the week of the year for a given date.

Types

type DateGenerator

type DateGenerator struct {
	FilenameToWrite string
	StartDate       time.Time
}

func NewDateGenerator

func NewDateGenerator(filename string, startDate string) (*DateGenerator, error)

func (DateGenerator) Persist

func (d DateGenerator) Persist(dates Dates) error

func (DateGenerator) RangeOfDates

func (d DateGenerator) RangeOfDates() (Dates, error)

RangeOfDates generates a list of dates for bi-weekly reports.

type Dates

type Dates []time.Time

func (Dates) String

func (d Dates) String() string

type Line

type Line int
const (
	NoneLine Line = iota
	HeaderLine
	BackgroundLine
	TaskLine
	ResultLine
	FeedbackLine
)

func NewLine

func NewLine(line string) Line

type Report

type Report struct {
	Date         string
	ReportNumber string
	WeekNumber   string
	Background   string
	Task         string
	Result       string
	Feedback     string
}

type ReportParser

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

func NewReportParser

func NewReportParser(file io.Reader) *ReportParser

func (*ReportParser) Parse

func (r *ReportParser) Parse() ([]Report, error)

type ReportProcessor

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

func NewReportProcessor

func NewReportProcessor(templateData []byte, reportTypes []string, file io.Reader) (*ReportProcessor, error)

func (*ReportProcessor) GenerateFileName

func (rp *ReportProcessor) GenerateFileName(report *Report, reportType string) (string, error)

func (*ReportProcessor) Process

func (rp *ReportProcessor) Process() ([]Report, error)

func (*ReportProcessor) ReplacePlaceholders

func (rp *ReportProcessor) ReplacePlaceholders(report *Report) docx.PlaceholderMap

Jump to

Keyboard shortcuts

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