Documentation
¶
Index ¶
- func Bintime(bin string, to string) (t time.Time)
- func Cut(s, sep string) (before, after string, found bool)
- func ExtractToolNameFromURL(url string) string
- func FatalHandler(err error) error
- func FilenameToAssetFilters(filename string) []string
- func FindChecksumAsset(asset Asset, assets []Asset) Asset
- func GetCurrentDirectory() string
- func GetRename(file string, nameguess string) string
- func IsDefinitelyNotExec(file string) bool
- func IsDirectory(path string) bool
- func IsErrorNotOf(err error, errorCompare error) bool
- func IsErrorOf(err error, errorCompare error) bool
- func IsExec(file string, mode os.FileMode) bool
- func IsGithubURL(s string) bool
- func IsInvalidGithubURL(s string) bool
- func IsLocalFile(s string) bool
- func IsNonGithubURL(s string) bool
- func IsURL(s string) bool
- func IsValidRepositoryReference(s string) bool
- func ModeFrom(fname string, mode fs.FileMode) fs.FileMode
- func RepositoryNameFromGithubURL(s string) (name string, found bool)
- func SameImplementedInterface(a, b any) bool
- func SetIf[T interface{}](condition bool, original T, newValue T) T
- type InvalidGitHubProjectReference
- type InvalidGitHubProjectURLError
- type RepositoryReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bintime ¶
async get the modification time of a filesystem file: Bintime returns the modification time of a file or directory.
func ExtractToolNameFromURL ¶
func FatalHandler ¶
func FilenameToAssetFilters ¶
FilenameToAssetFilters takes a filename string and returns a list of inclusive asset filters based on the filename it's used to avoid the need for prompting the user to select an asset on subsequent runs after having selected an asset on the first download.
func FindChecksumAsset ¶
func FindChecksumAsset(asset Asset, assets []Asset) Asset
searches for an asset thaat has the same name as the requested one but ending with .sha256 or .sha256sum
func GetCurrentDirectory ¶
func GetCurrentDirectory() string
func GetRename ¶
GetRename attempts to guess what to rename 'file' to for an appropriate executable name.
func IsDefinitelyNotExec ¶
IsDefinitelyNotExec returns true if the file is definitely not an executable.
func IsDirectory ¶
IsDirectory returns true if the file at 'path' is a directory.
func IsErrorNotOf ¶
IsErrorNotOf returns true if err is not nil and is not of the type errorCompare.
func IsExec ¶
IsExec returns true if the file is an executable based on the file name or the file mode (executable bit).
func IsGithubURL ¶
IsGithubURL returns true if s is a URL with github.com as the host.
func IsInvalidGithubURL ¶
func IsLocalFile ¶
IsLocalFile returns true if the file at 's' exists.
func IsNonGithubURL ¶
func IsValidRepositoryReference ¶
IsValidRepositoryReference returns true if s is a valid repository reference in the form of "owner/repo".
func SameImplementedInterface ¶
check if two interfaces implement the same type
Types ¶
type InvalidGitHubProjectReference ¶
type InvalidGitHubProjectReference = error
func NewInvalidGitHubProjectReferenceError ¶
func NewInvalidGitHubProjectReferenceError(reference string) InvalidGitHubProjectReference
type InvalidGitHubProjectURLError ¶
type InvalidGitHubProjectURLError = error
var InvalidGitHubProjectURL InvalidGitHubProjectURLError = errors.New("Invalid GitHub URL").(InvalidGitHubProjectURLError)
func NewInvalidGitHubProjectURLError ¶
func NewInvalidGitHubProjectURLError(_ string) InvalidGitHubProjectURLError
type RepositoryReference ¶
func ParseRepositoryReference ¶
func ParseRepositoryReference(s string) (*RepositoryReference, error)
func (*RepositoryReference) String ¶
func (rr *RepositoryReference) String() string