Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicWrite ¶
AtomicWrite moves src to dst atomically. It tries os.Rename first (same-filesystem fast path). On cross-filesystem moves, it copies src to a temp file in dst's directory and then renames to avoid partial writes.
func ExpandTemplate ¶
ExpandTemplate replaces placeholders in tpl:
{stem} — filename without extension
{to} — target format ID
{date} — current date as YYYYMMDD
{seq} — zero-padded 4-digit sequence number
Types ¶
type ConflictPolicy ¶
type ConflictPolicy int
ConflictPolicy controls what happens when the output file already exists.
const ( ConflictOverwrite ConflictPolicy = iota ConflictSkip ConflictRename ConflictError )
func ParseConflictPolicy ¶
func ParseConflictPolicy(s string) (ConflictPolicy, error)
ParseConflictPolicy parses a string policy name.
type Sink ¶
type Sink struct {
Type SinkType
Path string // empty for SinkTypeStdout
Format string // canonical target format ID
Policy ConflictPolicy // how to handle existing files
Template string // optional naming template for SinkTypeDir
}
Sink describes where converted output is written.
func ResolveSink ¶
ResolveSink determines the sink type from the output path string.
- "-" or empty → SinkTypeStdout
- path ending in "/" or existing directory → SinkTypeDir
- everything else → SinkTypeFile
Click to show internal directories.
Click to hide internal directories.