Help us shape the future of Go! Take the 2026 Go Developer Survey

gitremote

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package gitremote validates remote locations accepted by the native Git adapters.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid Git remote")

ErrInvalid indicates that a remote is malformed, unsupported, or embeds credentials.

View Source
var ErrRepositoryIdentity = errors.New("git remote has no hosted repository identity")

ErrRepositoryIdentity indicates that a valid remote does not encode a hosted OWNER/REPOSITORY identity.

Functions

func Validate

func Validate(remote string) error

Validate accepts local absolute paths, file URLs, HTTPS URLs, SSH URLs, and SCP-like SSH remotes. HTTPS userinfo and SSH passwords are never accepted; SSH usernames remain supported because they are not secrets.

Types

type RepositoryIdentity added in v0.10.0

type RepositoryIdentity struct {
	Host  string
	Owner string
	Repo  string
}

RepositoryIdentity is the credential-free hosted identity encoded by a remote URL.

func ParseRepositoryIdentity added in v0.10.0

func ParseRepositoryIdentity(remote string) (RepositoryIdentity, error)

ParseRepositoryIdentity extracts a hosted repository identity from an HTTPS, SSH URL, or SCP-like SSH remote. Local paths and file URLs are valid remotes but do not establish a hosted repository identity.

Jump to

Keyboard shortcuts

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