utils

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildVersion

func BuildVersion(Version, Commit, Date, BuiltBy string) string

BuildVersion constructs a formatted version string using build information. It combines the application version with details about the build environment and compilation settings for diagnostic and informational purposes.

-Version: The semantic version of the application (e.g., "v1.0.0"). -Commit: The Git commit hash of the source code used for the build. -Date: The timestamp when the build was created. -BuiltBy: The entity (person, CI system) that created the build. Returns: A multi-line string containing formatted version and build information.

func ValidateFilePath

func ValidateFilePath(path string) (string, error)

ValidateFilePath validates a file path to ensure it's safe for filesystem operations. It performs multiple security checks including path traversal prevention, character validation, and ensuring the path contains only a filename without directory components.

-path: The file path string to validate. Returns: The cleaned and validated file path, and an error if validation fails.

func ValidateWorkflowFilePath

func ValidateWorkflowFilePath(filePath string) error

ValidateWorkflowFilePath validates a workflow file path to ensure it is accessible within the project root and doesn't contain potentially unsafe path components.

-filePath: The path to the workflow file to validate. Returns: An error if the path is invalid, traverses outside project root, or cannot be resolved.

Types

This section is empty.

Jump to

Keyboard shortcuts

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