💾 Archived View for code.pfad.fr › vanitydoc › autodiscovery captured on 2023-11-14 at 07:50:38. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-09-08)
-=-=-=-=-=-=-
import "code.pfad.fr/vanitydoc/autodiscovery"
package autodiscovery is an implementation of the [VCS Autodiscovery RFC].
type Forge struct { RawFile string File string Dir string Summary string Line string }
Forge indicates the links used to navigate around the software forge.
type VCS struct { Type string DefaultBranch string Clone []string Forge Forge }
VCS represents the Version Control System being used.
func Gitea(domain, uri, defaultBranch string) VCS
Gitea generates VCS for gitea. For instance domain "codeberg.org", uri "pfad.fr/vanitydoc" and defaultBranch "main".
Gitea expects the type of "ref" in the URL (branch/main, tag/v1.0.0), so this is a bit hacky.
func Github(domain, uri, defaultBranch string) VCS
Github generates VCS for github. For instance domain "github.com", uri "fluhus/godoc-tricks" and defaultBranch "main".
func ParseURL(rawURL string) (VCS, error)
ParseURL parses a forge URL into a VCS struct. Use the scheme to specify the forge type:
Use the username to specify the default branch (main if unspecified):
func SourceHutGit(domain, uri, defaultBranch string) VCS
SourceHutGit generates VCS for git.sr.ht. Domain is usually "git.sr.ht", uri "~username/repo" and defaultBranch "main".
func (vcs VCS) GoImport(wr io.Writer, importPrefix string) error
GoImport writes the [go-import] meta tag.
func (vcs VCS) MetaTags(wr io.Writer) error
MetaTags writes the [VCS Autodiscovery RFC] meta tags (which are not empty).
https://codeberg.org/pfad.fr/vanitydoc
git clone
https://codeberg.org/pfad.fr/vanitydoc.git git@codeberg.org:pfad.fr/vanitydoc.git