pkgsite: golang.org/x/pkgsite/internal/fetch Index | Files | Directories

package fetch

import "golang.org/x/pkgsite/internal/fetch"

Index

Package Files

directory.go fetch.go limit.go test_helper.go

Constants

const (

    // MaxFileSize is the maximum filesize that is allowed for reading.
    // The fetch process should fail if it encounters a file exceeding
    // this limit.
    MaxFileSize = 30 * megabyte
)

Limits for discovery worker.

Variables

var MaxDocumentationHTML = 20 * megabyte

MaxDocumentationHTML is a limit on the rendered documentation HTML size.

The current limit of is based on the largest packages that pkg.go.dev has encountered. See https://golang.org/issue/40576.

It is a variable for testing.

type BadPackageError Uses

type BadPackageError struct {
    Err error // Not nil.
}

BadPackageError represents an error loading a package because its contents do not make up a valid package.

This can happen, for example, if the .go files fail to parse or declare different package names.

func (*BadPackageError) Error Uses

func (bpe *BadPackageError) Error() string

type FetchResult Uses

type FetchResult struct {
    ModulePath           string
    RequestedVersion     string
    ResolvedVersion      string
    GoModPath            string
    Status               int
    Error                error
    Module               *internal.Module
    PackageVersionStates []*internal.PackageVersionState
}

func FetchModule Uses

func FetchModule(ctx context.Context, modulePath, requestedVersion string, proxyClient *proxy.Client, sourceClient *source.Client) (fr *FetchResult)

FetchModule queries the proxy or the Go repo for the requested module version, downloads the module zip, and processes the contents to return an *internal.Module and related information.

Even if err is non-nil, the result may contain useful information, like the go.mod path.

Directories

PathSynopsis
dochtmlPackage dochtml renders Go package documentation into HTML.
dochtml/internal/renderPackage render formats Go documentation as HTML.
internal/docPackage doc extracts source code documentation from a Go AST.

Package fetch imports 36 packages (graph) and is imported by 6 packages. Updated 2020-08-05. Refresh now. Tools for package owners.