vcsurl

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPathDirs

func GetPathDirs(path string) []string

getPathDirs splits the URL path into non-empty segments.

Types

type Protocol added in v0.3.0

type Protocol int
const (
	SSH Protocol = iota
	HTTP
)

type VCSType added in v0.3.0

type VCSType int
const (
	UnknownVCS VCSType = iota // UnknownVCS means that the type of VCS is unknown and not specified and should be determined from the URL
	GenericVCS                // Generic means that we should use generic handler and dynamic ignore vcs determination
	Github                    // Github means that the VCS is Github
	Gitlab                    // Gitlab means that the VCS is Gitlab
	Bitbucket                 // Bitbucket means that the VCS is Bitbucket
)

func StringToVCSType added in v0.3.0

func StringToVCSType(s string) VCSType

StringToVCSType converts a string to a VCSType

type VCSURL added in v0.3.0

type VCSURL struct {
	VCSType       VCSType
	Namespace     string
	Repository    string
	Branch        string
	PullRequestId string
	HTTPRepoLink  string
	SSHRepoLink   string
	ParsedURL     *url.URL
	Raw           string
}

VCSURL represents a parsed VCS URL

func Parse added in v0.3.0

func Parse(raw string) (*VCSURL, error)

Parse parses a VCS URL and returns a VCSURL struct for unknown VCS Type

func ParseForVCSType added in v0.3.0

func ParseForVCSType(raw string, vcsType VCSType) (*VCSURL, error)

ParseForVCSType parses a VCS URL and returns a VCSURL struct for a specific VCS Type

func (*VCSURL) Protocol added in v0.3.0

func (u *VCSURL) Protocol() Protocol

GetProtocol returns the protocol of the VCS URL (HTTP or SSH)

Jump to

Keyboard shortcuts

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