package autodiscovery

import "git.sr.ht/~sircmpwn/gddo/internal/autodiscovery"

Package autodiscovery implements the VCS Autodiscovery RFC.

Index

Types

type Project

type Project struct {
	Summary string
	Dir     string
	File    string
	RawFile string
	Line    string
}

Project facilitates linking to project source code.

func Fetch

func Fetch(ctx context.Context, client *http.Client, seriesPath, userAgent string) (*Project, error)

Fetch fetches project information for the provided module series path. It returns nil if no project information was found.

func (*Project) DirURL

func (p *Project) DirURL(ref, dir string) string

DirURL returns a URL for the given directory.

func (*Project) FileURL

func (p *Project) FileURL(ref, dir, file string) string

FileURL returns a URL for the given file.

func (*Project) LineURL

func (p *Project) LineURL(ref, dir, file, line string) string

LineURL returns a link to the provided line.

func (*Project) RawFileURL

func (p *Project) RawFileURL(ref, dir, file string) string

RawFileURL returns a URL for the raw contents of the given file.

Source Files

autodiscovery.go

Version
v0.0.0-20240124133021-55358d4d592d (latest)
Published
Jan 24, 2024
Platform
linux/amd64
Imports
6 packages
Last checked
3 days ago

Tools for package owners.