Documentation
¶
Overview ¶
Package urlprotocol classifies a Git URL by the transport it names.
Split out of pkg/repository/url so it can be used from pkg/render, which must stay importable without dragging in a dependency graph: the rest of pkg/repository/url reaches oklog/ulid, samber/lo and golang.org/x/text, none of which a template needs to decide whether a fork URL is SSH-form. pkg/repository/url re-exports everything here, so its own callers are unaffected.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UsingHTTPBasedProtocol ¶
func UsingSSHBasedProtocol ¶
Types ¶
type Parsed ¶
Parsed is a Git URL broken into its parts.
The type lives here rather than in pkg/repository/url for the same reason the protocol constants do: pkg/config embeds it, and that package must stay importable without pulling the parsing machinery — which reaches oops, samber/lo and golang.org/x/text — along with it. pkg/repository/url aliases it and owns Parse.
func (*Parsed) AsHTTPsURL ¶
AsHTTPsURL renders the URL in https form, whatever transport it was written in.
type Protocol ¶
type Protocol string
func DetectProtocol ¶
DetectProtocol reports which transport unparsedURL names. Anything that does not carry an explicit http/https/ssh scheme is treated as SCP, which is how "git@host:path" shorthand is classified.