utils

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFNVHash

func GenerateFNVHash(data []byte) uint64

GenerateFNVHash generates a 64-bit FNV-1a hash from the input bytes

Types

type GitRemoteInfo added in v0.1.30

type GitRemoteInfo struct {
	Host        string // e.g., "gitlab.com" or "gitlab.example.com"
	ProjectPath string // e.g., "group/project" or "group/subgroup/project"
	URL         string // The full GitLab URL, e.g., "https://gitlab.com"
}

GitRemoteInfo contains parsed information from a git remote URL

func DetectGitRemote added in v0.1.30

func DetectGitRemote() *GitRemoteInfo

DetectGitRemote attempts to detect GitLab URL and project path from git remote. It tries the "origin" remote first. Returns nil if detection fails (not a git repo, no remote, not a GitLab URL, etc.)

func ParseGitRemoteURL added in v0.1.30

func ParseGitRemoteURL(remoteURL string) *GitRemoteInfo

ParseGitRemoteURL parses a git remote URL and extracts host and project path. Supports the following formats:

  • SSH URL: ssh://git@host[:port]/group/project.git
  • SSH SCP-like: git@host:group/project.git
  • HTTPS: https://host[:port]/group/project.git
  • Git protocol: git://host[:port]/group/project.git

Returns nil if the URL cannot be parsed.

Jump to

Keyboard shortcuts

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