autodiscovery

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

package autodiscovery is an implementation of the VCS Autodiscovery RFC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kind added in v0.9.0

func Kind(kind string) (func(url, defaultBranch string) VCS, error)

Types

type Forge

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

type VCS struct {
	Type          string
	DefaultBranch string
	Clone         []string
	Forge         Forge
}

VCS represents the Version Control System being used.

func Forgejo added in v0.9.0

func Forgejo(url, defaultBranch string) VCS

Forgejo generates VCS for forgejo. For instance "https://codeberg.org/pfad.fr/vanitydoc" and defaultBranch "main".

func Github

func Github(url, defaultBranch string) VCS

Github generates VCS for github. For instance "https://github.com/fluhus/godoc-tricks" and defaultBranch "main".

func SourceHutGit

func SourceHutGit(url, defaultBranch string) VCS

SourceHutGit generates VCS for git.sr.ht. For instance "https://git.sr.ht/~username/repo" and defaultBranch "main".

func (VCS) GoImport

func (vcs VCS) GoImport(wr io.Writer, importPrefix string) error

GoImport writes the go-import meta tag.

func (VCS) MetaTags

func (vcs VCS) MetaTags(wr io.Writer) error

MetaTags writes the VCS Autodiscovery RFC meta tags (which are not empty).

Jump to

Keyboard shortcuts

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