Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGitToken ¶ added in v1.1.0
func GetGitToken() string
getGitToken retrieves a Git token from either a configuration file or environment variable.
It first attempts to fetch the token from a configuration file using Viper.
If the token is not found in the configuration file, it then checks for the token in an environment variable.
If the token is found in neither location, an empty string is returned.
func GetParentPath ¶
GetParentPath takes a file or directory path as input and attempts to extract the parent path.
Parameters: - path: A string representing the file or directory path from which the parent path is to be extracted.
Returns:
- A boolean value indicating if it is a root path. True if the path is a root path, false otherwise.
- A string containing the parent path if found. If a "/" is present, this will be the path up to the last "/", excluding the "/" itself. If no "/" is found, indicating no parent path can be extracted, the function returns the original path.
Note: This function is designed to work with UNIX-like file system paths that use "/" as a directory separator. It does not handle Windows paths that use "\" as a directory separator.
func ParseContentsUrl ¶
ParseContentsUrl takes a path and a sha or branch and returns a url for git Tree.
Parameters:
- repoIdtenty: {owner}/{repo} Repo owner and Repo name.
- sha: The sha or branch of the repo.
Returns: - A string containing the url for git Tree.
Types ¶
This section is empty.