utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBinaryPath

func GetBinaryPath() (string, error)

func IsValidURL

func IsValidURL(input string) bool

isValidURL checks if the given string is a valid URL

func ParseGithubURL

func ParseGithubURL(githubURL string) (owner, repo, version string, err error)

ParseGithubURL extracts the repository owner, repo name, and it's version. For URLs like "https://github.com/interlynk-io/sbomqs@v1.0.0", returns "interlynk-io", "sbomqs", "v1.0.0", nil). For URLs like "https://github.com/interlynk-io/sbomqs", returns "interlynk-io", "sbomqs", "", nil). For URLs like "https://github.com/interlynk-io/", returns "interlynk-io", "", "", nil).

func ParseRepoVersion

func ParseRepoVersion(repoURL string) (string, string, error)

ParseRepoVersion extracts the repository URL without version and version from a GitHub URL. For URLs like "https://github.com/owner/repo", returns ("https://github.com/owner/repo", "latest", nil). For URLs like "https://github.com/owner/repo@v1.0.0", returns ("https://github.com/owner/repo", "v1.0.0", nil).

Types

This section is empty.

Jump to

Keyboard shortcuts

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