package internal

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

Index

Constants

const LatestVersion = "latest"

Variables

var (
	// ErrNotFound indicates that the requested module was not found.
	ErrNotFound = errors.New("not found")

	// ErrInvalidPath indicates that the requested module path is invalid.
	ErrInvalidPath = errors.New("invalid path")

	// ErrInvalidVersion indicates that the requested version is invalid.
	ErrInvalidVersion = errors.New("invalid version")

	// ErrBadModule indicates a problem with a module.
	ErrBadModule = errors.New("bad module")

	// ErrTooLarge indicates that the requested module is too large to fetch.
	ErrTooLarge = errors.New("too large")
)

Types

type Module

type Module struct {
	ModulePath    string
	RawModulePath string
	SeriesPath    string
	Version       string
	RawVersion    string
	Reference     string
	CommitTime    time.Time
	LatestVersion string
	Versions      []string
	Deprecated    string
	Updated       time.Time // TODO: remove this
	ZipSize       int64
}

Module contains module information.

type Source

type Source interface {
	Module(modulePath, version string) (*Module, error)
	Files(module *Module) (fs.FS, error)
}

Source represents a source of Go modules.

type SourceList

type SourceList []Source

SourceList fetches modules by trying a list of module sources.

func (SourceList) FindModule

func (list SourceList) FindModule(modulePath, version string) (Source, *Module, error)

FindModule finds the given module, returning the module and the module source which resolved it.

Source Files

source.go

Directories

PathSynopsis
internal/autodiscoveryPackage autodiscovery implements the [VCS Autodiscovery RFC].
internal/databasePackage database manages the storage of documentation.
internal/godocPackage godoc is for rendering Go documentation.
internal/godoc/codecPackage codec implements the general-purpose part of an encoder for Go values.
internal/httputilPackage httputil provides HTTP utility functions.
internal/proxyPackage proxy provides support for fetching modules from a Go module proxy.
internal/renderPackage render implements rendering of Go code.
internal/serverPackage server implements the Go documentation server.
internal/stdlibPackage stdlib supports special handling of the Go standard library.
Version
v0.0.0-20240124133021-55358d4d592d (latest)
Published
Jan 24, 2024
Platform
linux/amd64
Imports
3 packages
Last checked
1 day ago

Tools for package owners.