url

package
v1.26.4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRepositoryWebLink(repoURL *RepositoryURL) string

MakeRepositoryWebLink generates a web link (http/https) for a git repository (by guessing sometimes)

Types

type ErrWrongURLFormat

type ErrWrongURLFormat struct {
	URL string
}

ErrWrongURLFormat represents an error with wrong url format

func (ErrWrongURLFormat) Error

func (err ErrWrongURLFormat) Error() string

type GitURL

type GitURL struct {
	*stdurl.URL
	// contains filtered or unexported fields
}

GitURL represents a git URL

func ParseGitURL added in v1.24.0

func ParseGitURL(remote string) (*GitURL, error)

ParseGitURL parse all kinds of git URL: * Full URL: http://git@host/path, http://git@host:port/path * SCP short syntax: git@host:/path * File path: /dir/repo/path

func (*GitURL) String

func (u *GitURL) String() string

String returns the URL's string

type RepositoryURL added in v1.24.0

type RepositoryURL struct {
	GitURL *GitURL

	// if the URL belongs to current Gitea instance, then the below fields have values
	OwnerName     string
	RepoName      string
	RemainingPath string
}

func ParseRepositoryURL added in v1.24.0

func ParseRepositoryURL(ctx context.Context, repoURL string) (*RepositoryURL, error)

ParseRepositoryURL tries to parse a Git URL and extract the owner/repository name if it belongs to current Gitea instance.

Jump to

Keyboard shortcuts

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