giturl

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package giturl provides shared helpers for classifying Git repository URLs and redacting them inside error messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSCPStyle

func IsSCPStyle(repoURL string) bool

IsSCPStyle reports whether repoURL is an SCP-style Git URL (user@host:path).

func IsSSHURL

func IsSSHURL(repoURL string) bool

IsSSHURL reports whether repoURL uses SSH transport, either via an explicit ssh:// scheme or SCP-style syntax.

func RedactInMessage

func RedactInMessage(message, repoURL, redacted string) string

RedactInMessage replaces every recognizable form of repoURL inside message with the caller-supplied redacted placeholder: the raw URL, its .git-less variant, fragment/query/userinfo-stripped variants, and any embedded userinfo, query, or fragment components.

func SSHUser

func SSHUser(repoURL string) string

SSHUser returns the username encoded in repoURL, defaulting to "git".

Types

This section is empty.

Jump to

Keyboard shortcuts

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