pathtemplate

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: 6 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 pathtemplate expands filesystem paths for a reporting month.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(pattern string, ctx Context, funcMaps ...template.FuncMap) (string, error)

Expand executes pattern with ctx. Function maps are registered in order before parsing, with later definitions taking precedence. Blank paths return an error.

Types

type Context

type Context struct {
	Year      string // YYYY
	Month     string // MM
	YearMonth string // YYYY-MM
	Env       map[string]string
}

Context contains the reporting month and environment exposed to path templates.

func NewContext

func NewContext(month time.Time) Context

NewContext builds a context for month with a snapshot of the process environment.

Jump to

Keyboard shortcuts

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