configs

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 3 Imported by: ? modules, 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

Index

Constants

View Source
const (
	// Config directory and file names
	ConfigDirName     = ".autopdf"
	ConfigFileName    = "config.yaml"
	FallbackConfigDir = "autopdf-config.yaml"
)

File and Directory Constants

View Source
const (
	DefaultDebugOutput = "stdout"
	DefaultLogOutput   = "stdout"
)

Default Debug Output

View Source
const (
	// Directory and file errors
	ErrDirectoryNotExists = "directory does not exist: %s"
	ErrConfigDirCreate    = "failed to create config directory"
	ErrConfigFileWrite    = "failed to write config file"

	// Service errors
	ErrServiceCreation  = "failed to create service"
	ErrServiceExecution = "service execution failed"
	ErrServiceCleanup   = "service cleanup failed"

	// Configuration errors
	ErrConfigLoad       = "failed to load configuration"
	ErrConfigSave       = "failed to save configuration"
	ErrConfigValidation = "configuration validation failed"

	// File operation errors
	ErrFileNotFound = "file not found: %s"
	ErrFileRead     = "failed to read file: %s"
	ErrFileWrite    = "failed to write file: %s"
	ErrFileDelete   = "failed to delete file: %s"

	// Template processing errors
	ErrTemplateProcess = "template processing failed"
	ErrTemplateCompile = "template compilation failed"
	ErrTemplateRender  = "template rendering failed"

	// LaTeX compilation errors
	ErrLaTeXCompile = "LaTeX compilation failed"
	ErrLaTeXEngine  = "LaTeX engine not found"
	ErrLaTeXOutput  = "LaTeX output generation failed"

	// Conversion errors
	ErrPDFConversion     = "PDF conversion failed"
	ErrImageGeneration   = "image generation failed"
	ErrFormatUnsupported = "unsupported format: %s"

	// Cleanup errors
	ErrAuxCleanup  = "auxiliary file cleanup failed"
	ErrTempCleanup = "temporary file cleanup failed"
)

Error Messages

View Source
const (
	// Logging defaults
	DefaultVerboseLevel = 2 // Detailed information
	DefaultLogLevel     = "info"

	// File watching defaults
	DefaultWatchInterval = "1s"
	DefaultDebounceTime  = "500ms"

	// Parallel processing defaults
	DefaultMaxConcurrency = 4
	DefaultTimeout        = "30s"

	// Cleanup defaults
	DefaultCleanEnabled = false
	DefaultForceEnabled = false
	DefaultDebugEnabled = false
)

Default Values

View Source
const (
	// Home directory fallback
	TempDirFallback = "/tmp"

	// Config file permissions
	ConfigDirPerms  = 0755
	ConfigFilePerms = 0644
)

Path Constants

View Source
const (
	ServiceDocument   = "document"
	ServiceOptions    = "options"
	ServiceParallel   = "parallel"
	ServicePersistent = "persistent"
	ServiceWatch      = "watch"
	ServiceClean      = "clean"
	ServiceVerbose    = "verbose"
	ServiceDebug      = "debug"
	ServiceForce      = "force"
	ServiceConvert    = "convert"
	ServiceConfig     = "config"
)

Service Names

View Source
const (
	LogLevelSilent   = "silent"
	LogLevelBasic    = "basic"
	LogLevelDetailed = "detailed"
	LogLevelDebug    = "debug"
	LogLevelMaximum  = "maximum"
)

Log Level Names

View Source
const (
	OutputFormatStdout = "stdout"
	OutputFormatStderr = "stderr"
	OutputFormatBoth   = "both"
	OutputFormatFile   = "file"
)

Output Format Names

View Source
const (
	ExtensionTex   = ".tex"
	ExtensionPDF   = ".pdf"
	ExtensionPNG   = ".png"
	ExtensionJPEG  = ".jpg"
	ExtensionJPEG2 = ".jpeg"
	ExtensionSVG   = ".svg"
	ExtensionYAML  = ".yaml"
	ExtensionYML   = ".yml"
	ExtensionJSON  = ".json"
)

File Type Extensions

View Source
const (
	TemplateStartDelim = "delim[["
	TemplateEndDelim   = "]]"
)

Template Delimiters

View Source
const (
	DefaultEngine       = "pdflatex"
	DefaultOutputFormat = "pdf"
	DefaultTemplateName = "template.tex"
	DefaultConfigName   = "config.yaml"
	DefaultOutputName   = "output.pdf"
)

Default Configuration Values

View Source
const (
	ErrorCategoryConfig     = "configuration"
	ErrorCategoryFile       = "file_operation"
	ErrorCategoryTemplate   = "template"
	ErrorCategoryLaTeX      = "latex"
	ErrorCategoryConversion = "conversion"
	ErrorCategoryCleanup    = "cleanup"
	ErrorCategoryService    = "service"
	ErrorCategoryNetwork    = "network"
	ErrorCategorySystem     = "system"
)

Error Categories

View Source
const (
	StatusSuccess    = "success"
	StatusError      = "error"
	StatusWarning    = "warning"
	StatusInfo       = "info"
	StatusDebug      = "debug"
	StatusProcessing = "processing"
	StatusCompleted  = "completed"
	StatusFailed     = "failed"
	StatusSkipped    = "skipped"
	StatusPending    = "pending"
)

Status Messages

View Source
const (
	MsgConfigLoaded       = "Configuration loaded successfully"
	MsgConfigSaved        = "Configuration saved successfully"
	MsgServiceStarted     = "Service started successfully"
	MsgServiceStopped     = "Service stopped successfully"
	MsgFileProcessed      = "File processed successfully"
	MsgFileSkipped        = "File skipped"
	MsgFileError          = "File processing error"
	MsgCleanupComplete    = "Cleanup completed successfully"
	MsgBuildComplete      = "Build completed successfully"
	MsgBuildFailed        = "Build failed"
	MsgConversionComplete = "Conversion completed successfully"
	MsgConversionFailed   = "Conversion failed"
)

Default Messages

Variables

View Source
var (
	ConfigFileExistsError = fmt.Errorf("config file already exists")
	ConfigFileWriteError  = fmt.Errorf("failed to write config file")
	BuildError            = fmt.Errorf("failed to build config")
	WriteError            = fmt.Errorf("failed to write config")
	ReadError             = fmt.Errorf("failed to read config")
	ParseError            = fmt.Errorf("failed to parse config")
	TemplateError         = fmt.Errorf("failed to process template")
	ConversionError       = fmt.Errorf("failed to convert PDF to images")
	CleanError            = fmt.Errorf("failed to clean up auxiliary files")

	// Command-specific errors
	UnknownSubcommandError = fmt.Errorf("unknown subcommand")
	ConfigOperationError   = fmt.Errorf("config operation failed")
	ConvertOperationError  = fmt.Errorf("convert operation failed")
	BuildOperationError    = fmt.Errorf("build operation failed")
)

Standardized error types

View Source
var AuxiliaryExtensions = []string{
	".aux", ".log", ".toc", ".lof", ".lot", ".out", ".nav", ".snm",
	".synctex.gz", ".fls", ".fdb_latexmk", ".bbl", ".blg", ".run.xml",
	".bcf", ".idx", ".ilg", ".ind", ".brf", ".vrb", ".xdv", ".dvi",
}

LaTeX Auxiliary File Extensions

View Source
var DefaultExclusionPatterns = []string{
	"*.aux", "*.log", "*.out", "*.toc",
	"*.lof", "*.lot", "*.nav", "*.snm",
	"*.vrb", "*.fls", "*.fdb_latexmk",
	"*.synctex.gz", "*.bbl", "*.blg",
	"*.run.xml", "*.bcf", "*.idx",
	"*.ilg", "*.ind", "*.brf", "*.xdv", "*.dvi",
}

Default Exclusion Patterns for File Watching

View Source
var VerboseLevelDescriptions = map[int]string{
	0: "Silent (only errors)",
	1: "Basic information (warnings and above)",
	2: "Detailed information (info and above)",
	3: "Debug information (debug and above)",
	4: "Maximum verbosity (all logs with full introspection)",
}

Verbose Level Descriptions

Functions

func CreateLoggerContext added in v1.2.0

func CreateLoggerContext() (context.Context, *logger.LoggerAdapter)

CreateLoggerContext creates a new context with logger

func GetLoggerFromContext added in v1.2.0

func GetLoggerFromContext(ctx context.Context) *logger.LoggerAdapter

GetLoggerFromContext extracts logger from context with fallback

Types

type ContextKey added in v1.2.0

type ContextKey string

Context key type for logger

const LoggerKey ContextKey = "logger"

Jump to

Keyboard shortcuts

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