Documentation
¶
Overview ¶
Package common provides shared utilities for output plugins.
Package common provides shared utilities for output plugins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidPath ¶ added in v0.1.28
IsValidPath checks if a path is safe to use in exec.Command arguments. It rejects paths containing directory traversal (..) or shell metacharacters that could be exploited if the path were ever passed through a shell. This is defense-in-depth — exec.Command does not invoke a shell, but we guard against future misuse.
func MakeScriptExecutable ¶ added in v0.1.28
MakeScriptExecutable searches writtenFiles for a file with the given base name and makes it executable (0o750). Errors are logged as warnings when verbose is true but never returned — a non-executable script is not fatal.
func TemplateFuncs ¶
TemplateFuncs returns standard template functions for all output plugins. This delegates to the public pkg/template.TemplateFuncs() to avoid duplication. Both internal and external plugins use the same template functions for consistency.
Types ¶
type VerboseLogger ¶
type VerboseLogger struct {
// contains filtered or unexported fields
}
VerboseLogger implements a simple logger that writes to an io.Writer. This is used by output plugins that need to log verbose information. during template processing or generation.
func NewVerboseLogger ¶
func NewVerboseLogger(out io.Writer) *VerboseLogger
NewVerboseLogger creates a new VerboseLogger that writes to the given writer.
func (*VerboseLogger) Printf ¶
func (l *VerboseLogger) Printf(format string, v ...any)
Printf writes a formatted message to the logger's output writer. A newline is automatically appended to the format string.