Categorygithub.com/alranel/go-vcsurl/v2
modulepackage
2.0.2
Repository: https://github.com/alranel/go-vcsurl.git
Documentation: pkg.go.dev

# README

go-vcsurl

Go library for parsing and manipulating URLs of VCS services

Overview GoDoc

This package provides useful functions for parsing and manipulating URLs of VCS services such as GitHub, GitLab, BitBucket. It can be used to check whether a given URL points to an account, a repository, a file or a raw file. It also provides functions for converting file URLs to raw URLs and root raw URLs.

Install

go get github.com/alranel/go-vcsurl/v2

Author

Alessandro Ranellucci

License

MIT

# Functions

GetRawFile returns the raw URL corresponding to the supplied file URL.
GetRawRoot returns the URL of the raw repository root containing the supplied file.
GetRepo returns the URL of the main page of the repository (i.e.
IsAccount returns true if the supplied URL points to the root page of an org or user account.
IsBitBucket returns true if the supplied URL belongs to BitBucket.
IsFile returns true if the supplied URL points to a file in non-raw mode.
IsGitHub returns true if the supplied URL belongs to GitHub.
IsGitLab returns true if the supplied URL belongs to BitBucket.
IsHttpRepo returns true if the supplied URL points to an HTTP git repository.
IsRawFile returns true if the supplied URL points to a raw file.
IsRawRoot returns true if the supplied URL is the root for raw files.
IsRepo returns true if the supplied URL points to the root page of a repository.