giturl

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package giturl parses different git url syntax

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHTTPSURL

func IsHTTPSURL(rawURL string) bool

IsHTTPSURL returns true if supplied URL is HTTPS URL

func IsLocalURL

func IsLocalURL(rawURL string) bool

IsLocalURL returns true if supplied URL is HTTPS URL

func IsSCPURL

func IsSCPURL(rawURL string) bool

IsSCPURL returns true if supplied URL is scp-like syntax

func IsSSHURL

func IsSSHURL(rawURL string) bool

IsSSHURL returns true if supplied URL is SSH URL

func NormaliseURL

func NormaliseURL(rawURL string) string

NormaliseURL will return normalised url

func SameRawURL

func SameRawURL(lRepo, rRepo string) (bool, error)

SameRawURL returns whether or not the two remote URL strings are equivalent

Types

type URL

type URL struct {
	Scheme string // value will be either 'scp', 'ssh', 'https' or 'local'
	User   string // might be empty for http and local urls
	Host   string // host or host:port
	Path   string // path to the repo
	Repo   string // repository name from the path includes .git
}

URL represents parsed git url

func Parse

func Parse(rawURL string) (*URL, error)

Parse parses a raw url into a GitURL structure. valid git urls are...

func (*URL) Equals

func (lURL *URL) Equals(rURL *URL) bool

Equals returns whether or not the two parsed git URLs are equivalent. git URLs can be represented in multiple schemes so if host, path and repo name of URLs are same then those URLs are for the same remote repository

Jump to

Keyboard shortcuts

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