package internal

Import Path
	golang.org/x/pkgsite/internal (on go.dev)

Dependency Relation
	imports 14 packages, and imported by 19 packages

Involved Source Files build_context.go datasource.go discovery.go Package internal contains data used through x/pkgsite. latest.go nonredist.go paths.go symbol.go unit.go
Package-Level Type Names (total 24, all are exported)
/* sort exporteds by: | */
A BuildContext describes a build context for the Go tool: information needed to build a Go package. For our purposes, we only care about the information that affects documentation generated from the package. GOARCH string GOOS string Match reports whether its receiver, which acts like a pattern, matches its target, an ordinary BuildContext. In addition to the usual values, a pattern can have an empty GOOS or GOARCH, which means "match anything." String returns a string formatted representation of the build context. T : expvar.Var T : fmt.Stringer func (*Documentation).BuildContext() BuildContext func (*SymbolBuildContexts).BuildContexts() []BuildContext func CompareBuildContexts(c1, c2 BuildContext) int func DocumentationForBuildContext(docs []*Documentation, bc BuildContext) *Documentation func BuildContext.Match(target BuildContext) bool func DataSource.GetUnit(ctx context.Context, pathInfo *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func (*SymbolBuildContexts).AddBuildContext(build BuildContext) func (*SymbolBuildContexts).SupportsBuild(build BuildContext) bool func (*SymbolHistory).AddSymbol(sm SymbolMeta, v string, build BuildContext) func (*SymbolHistory).GetSymbol(name, v string, build BuildContext) (_ *SymbolMeta, err error) func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetUnit(ctx context.Context, pathInfo *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/postgres.GetSymbolHistoryForBuildContext(ctx context.Context, ddb *database.DB, pathID int, modulePath string, bc BuildContext) (_ map[string]string, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetUnit(ctx context.Context, um *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetUnit(ctx context.Context, um *UnitMeta, field FieldSet, bc BuildContext) (_ *Unit, err error) var BuildContextAll var BuildContextDarwin var BuildContextJS var BuildContextLinux var BuildContextWindows
DataSource is the interface used by the frontend to interact with module data. GetLatestInfo gets information about the latest versions of a unit and module. See LatestInfo for documentation. GetModuleReadme gets the readme for the module. GetNestedModules returns the latest major version of all nested modules given a modulePath path prefix. GetUnit returns information about a directory, which may also be a module and/or package. The module and version must both be known. The BuildContext selects the documentation to read. GetUnitMeta returns information about a path. *golang.org/x/pkgsite/internal/localdatasource.DataSource *golang.org/x/pkgsite/internal/postgres.DB *golang.org/x/pkgsite/internal/proxydatasource.DataSource
Documentation is the rendered documentation for a given package for a specific GOOS and GOARCH. API []*Symbol GOARCH string The values of the GOOS and GOARCH environment variables used to parse the package. // encoded ast.Files; see godoc.Package.Encode Synopsis string BuildContext returns the BuildContext for d. func DocumentationForBuildContext(docs []*Documentation, bc BuildContext) *Documentation func golang.org/x/pkgsite/internal/testing/sample.Documentation(goos, goarch, fileContents string) *Documentation func DocumentationForBuildContext(docs []*Documentation, bc BuildContext) *Documentation var golang.org/x/pkgsite/internal/testing/sample.Doc *Documentation
Experiment holds data associated with an experimental feature for frontend or worker. Description provides a description of the experiment. Name is the name of the feature. Rollout is the percentage of requests enrolled in the experiment. func golang.org/x/pkgsite/internal/middleware.(*Experimenter).Experiments() []*Experiment func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetExperiments(ctx context.Context) ([]*Experiment, error)
A FieldSet is a bit set of struct fields. It is used to avoid reading large struct fields from the data store. FieldSet is also the type of the individual bit values. (Think of them as singleton sets.) MinimalFields (the zero value) is the empty set. AllFields is the set containing every field. FieldSet bits are unique across the entire project, because some types are concatenations (via embedding) of others. For example, a func DataSource.GetUnit(ctx context.Context, pathInfo *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetUnit(ctx context.Context, pathInfo *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetUnit(ctx context.Context, um *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetUnit(ctx context.Context, um *UnitMeta, field FieldSet, bc BuildContext) (_ *Unit, err error) const AllFields const MinimalFields const WithImports const WithLicenses const WithMain
IndexVersion holds the version information returned by the module index. Path string Timestamp time.Time Version string func golang.org/x/pkgsite/internal/index.(*Client).GetVersions(ctx context.Context, since time.Time, limit int) (_ []*IndexVersion, err error) func golang.org/x/pkgsite/internal/index.SetupTestIndex(t *testing.T, versions []*IndexVersion) (*index.Client, func()) func golang.org/x/pkgsite/internal/postgres.(*DB).InsertIndexVersions(ctx context.Context, versions []*IndexVersion) (err error)
LatestInfo holds information about the latest versions and paths. The information is relative to a unit in a module. MajorModulePath is the path of the latest module path in the series. For example, in the module path "github.com/casbin/casbin", there is another module path with a greater major version "github.com/casbin/casbin/v3". This field will be "github.com/casbin/casbin/v3" or the input module path if no later module path was found. MajorUnitPath is the path of the unit in the latest major version of the module, if it exists. For example, if the module is M, the unit is M/U, and the latest major version is 3, then is field is "M/v3/U". If the module version at MajorModulePath does not contain this unit, then it is the module path." MinorModulePath is the module path for MinorVersion. MinorVersion is the latest minor version for the unit, regardless of module. UnitExistsAtMinor is whether the unit exists at the latest minor version of the module func DataSource.GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) (LatestInfo, error) func golang.org/x/pkgsite/internal/frontend.(*Server).GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) LatestInfo func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) (LatestInfo, error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) (latest LatestInfo, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) (latest LatestInfo, err error)
LatestModuleVersions describes the latest versions of a module. It also holds the go.mod file of the raw latest version, which establishes whether the module is deprecated, and what versions are retracted. // considering retractions Deprecated bool // of raw // successfully processed ModulePath string // ignoring retractions IsRetracted reports whether the version is retracted according to the go.mod file in the receiver. PopulateModuleInfo uses the LatestModuleVersions to populate fields of the given module. func NewLatestModuleVersions(modulePath, raw, cooked, good string, modBytes []byte) (*LatestModuleVersions, error) func golang.org/x/pkgsite/internal/fetch.LatestModuleVersions(ctx context.Context, modulePath string, prox *proxy.Client, hasGoMod func(v string) (bool, error)) (info *LatestModuleVersions, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetLatestModuleVersions(ctx context.Context, modulePath string) (_ *LatestModuleVersions, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).UpdateLatestModuleVersions(ctx context.Context, vNew *LatestModuleVersions) (_ *LatestModuleVersions, err error) func golang.org/x/pkgsite/internal/worker.(*Fetcher).FetchAndUpdateLatest(ctx context.Context, modulePath string) (_ *LatestModuleVersions, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).InsertModule(ctx context.Context, m *Module, lmv *LatestModuleVersions) (isLatest bool, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).UpdateLatestModuleVersions(ctx context.Context, vNew *LatestModuleVersions) (_ *LatestModuleVersions, err error)
A Module is a specific, reproducible build of a module. Licenses holds all licenses within this module version, including those that may be contained in nested subdirectories. ModuleInfo ModuleInfo ModuleInfo.CommitTime time.Time Deprecated describes whether the module is deprecated. DeprecationComment is the comment describing the deprecation, if any. HasGoMod describes whether the module zip has a go.mod file. ModuleInfo.IsRedistributable bool ModuleInfo.ModulePath string Retracted describes whether the module version is retracted. RetractionRationale is the reason for the retraction, if any. ModuleInfo.SourceInfo *source.Info ModuleInfo.Version string Units []*Unit Packages returns all of the units for a module that are packages. (*T) RemoveNonRedistributableData() SeriesPath returns the series path for the module. A series is a group of modules that share the same base path and are assumed to be major-version variants. The series path is the module path without the version. For most modules, this will be the module path for all module versions with major version 0 or 1. For gopkg.in modules, the series path does not correspond to any module version. Examples: The module paths "a/b" and "a/b/v2" both have series path "a/b". The module paths "gopkg.in/yaml.v1" and "gopkg.in/yaml.v2" both have series path "gopkg.in/yaml". func golang.org/x/pkgsite/internal/testing/sample.AddPackage(m *Module, pkg *Unit) *Module func golang.org/x/pkgsite/internal/testing/sample.DefaultModule() *Module func golang.org/x/pkgsite/internal/testing/sample.Module(modulePath, version string, suffixes ...string) *Module func golang.org/x/pkgsite/internal/postgres.MustInsertModule(ctx context.Context, t *testing.T, db *postgres.DB, m *Module) func golang.org/x/pkgsite/internal/postgres.MustInsertModuleGoMod(ctx context.Context, t *testing.T, db *postgres.DB, m *Module, goMod string) func golang.org/x/pkgsite/internal/postgres.MustInsertModuleNotLatest(ctx context.Context, t *testing.T, db *postgres.DB, m *Module) func golang.org/x/pkgsite/internal/postgres.(*DB).InsertModule(ctx context.Context, m *Module, lmv *LatestModuleVersions) (isLatest bool, err error) func golang.org/x/pkgsite/internal/testing/sample.AddLicense(m *Module, lic *licenses.License) func golang.org/x/pkgsite/internal/testing/sample.AddPackage(m *Module, pkg *Unit) *Module func golang.org/x/pkgsite/internal/testing/sample.AddUnit(m *Module, u *Unit) func golang.org/x/pkgsite/internal/testing/sample.ReplaceLicense(m *Module, lic *licenses.License)
ModuleInfo holds metadata associated with a module. CommitTime time.Time Deprecated describes whether the module is deprecated. DeprecationComment is the comment describing the deprecation, if any. HasGoMod describes whether the module zip has a go.mod file. IsRedistributable bool ModulePath string Retracted describes whether the module version is retracted. RetractionRationale is the reason for the retraction, if any. SourceInfo *source.Info Version string SeriesPath returns the series path for the module. A series is a group of modules that share the same base path and are assumed to be major-version variants. The series path is the module path without the version. For most modules, this will be the module path for all module versions with major version 0 or 1. For gopkg.in modules, the series path does not correspond to any module version. Examples: The module paths "a/b" and "a/b/v2" both have series path "a/b". The module paths "gopkg.in/yaml.v1" and "gopkg.in/yaml.v2" both have series path "gopkg.in/yaml". func DataSource.GetNestedModules(ctx context.Context, modulePath string) ([]*ModuleInfo, error) func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetNestedModules(ctx context.Context, modulePath string) ([]*ModuleInfo, error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetModuleInfo(ctx context.Context, modulePath, resolvedVersion string) (_ *ModuleInfo, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetNestedModules(ctx context.Context, modulePath string) (_ []*ModuleInfo, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetVersionsForPath(ctx context.Context, path string) (_ []*ModuleInfo, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetModuleInfo(ctx context.Context, modulePath, version string) (_ *ModuleInfo, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetNestedModules(ctx context.Context, modulePath string) (_ []*ModuleInfo, err error) func golang.org/x/pkgsite/internal/testing/sample.ModuleInfo(modulePath, versionString string) *ModuleInfo func (*LatestModuleVersions).PopulateModuleInfo(mi *ModuleInfo) func golang.org/x/pkgsite/internal/frontend.LegacyReadmeHTML(ctx context.Context, mi *ModuleInfo, readme *Readme) (_ safehtml.HTML, err error) func golang.org/x/pkgsite/internal/testing/sample.UnitForModuleRoot(m *ModuleInfo) *Unit
ModuleVersionState holds a worker module version state. AppVersion is the value of the GAE_VERSION environment variable, which is set by app engine. It is a timestamp in the format 20190709t112655 that is close to, but not the same as, the deployment time. For example, the deployment time for the above timestamp might be Jul 9, 2019, 11:29:59 AM. CreatedAt is the time this version was originally inserted into the module version state table. Error is the most recent HTTP response body received from the Fetch service, for a response with an unsuccessful status code. It is used for debugging only, and has no semantic significance. GoModPath is the path declared in the go.mod file fetched from the proxy. HasGoMod says whether the zip file has a go.mod file. IndexTimestamp is the timestamp received from the Index for this version, which should correspond to the time this version was committed to the Index. LastProcessedAt is the last time this version was updated with a result from the fetch service. ModulePath string NextProcessedAfter is the next time a fetch for this version should be attempted. NumPackages it the number of packages that were processed as part of the module (regardless of whether the processing was successful). Status is the most recent HTTP status code received from the Fetch service for this version, or nil if no request to the fetch service has been made. TryCount is the number of times a fetch of this version has been attempted. Version string func golang.org/x/pkgsite/internal/postgres.(*DB).GetModuleVersionState(ctx context.Context, modulePath, resolvedVersion string) (_ *ModuleVersionState, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetNextModulesToFetch(ctx context.Context, limit int) (_ []*ModuleVersionState, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetRecentFailedVersions(ctx context.Context, limit int) (_ []*ModuleVersionState, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetRecentVersions(ctx context.Context, limit int) (_ []*ModuleVersionState, err error)
PackageMeta represents the metadata of a package in a module version. IsRedistributable bool // metadata of applicable licenses Name string Path string Synopsis string (*T) RemoveNonRedistributableData() func golang.org/x/pkgsite/internal/testing/sample.PackageMeta(fullPath string) *PackageMeta
PackageVersionState holds a worker package version state. It is associated with a given module version state. Error string ModulePath string PackagePath string Status int Version string func golang.org/x/pkgsite/internal/postgres.(*DB).GetPackageVersionState(ctx context.Context, pkgPath, modulePath, resolvedVersion string) (_ *PackageVersionState, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetPackageVersionStatesForModule(ctx context.Context, modulePath, resolvedVersion string) (_ []*PackageVersionState, err error)
Readme is a README at the specified filepath. Contents string Filepath string func DataSource.GetModuleReadme(ctx context.Context, modulePath, resolvedVersion string) (*Readme, error) func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetModuleReadme(ctx context.Context, modulePath, resolvedVersion string) (*Readme, error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetModuleReadme(ctx context.Context, modulePath, resolvedVersion string) (_ *Readme, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetModuleReadme(ctx context.Context, modulePath, resolvedVersion string) (*Readme, error) func golang.org/x/pkgsite/internal/frontend.LegacyReadmeHTML(ctx context.Context, mi *ModuleInfo, readme *Readme) (_ safehtml.HTML, err error)
SearchResult represents a single search result from SearchDocuments. Approximate reports whether NumResults is an approximate count. NumResults can be approximate if search scanned only a subset of documents, and result count is estimated using the hyperloglog algorithm. CommitTime time.Time Licenses []string LowerMajor is a list of SearchResults with the same v1 path but at lower major versions of this module. ModulePath string Name string NumImportedBy is the number of packages that import PackagePath. NumResults is the total number of packages that were returned for this search. PackagePath string SameModule is a list of SearchResults from the same module as this one, with lower scores. Score is used to sort items in an array of SearchResult. Symbols are the symbols returned by a search request. Synopsis string Version string func golang.org/x/pkgsite/internal/postgres.(*DB).Search(ctx context.Context, q string, limit, offset, maxResultCount int, searchSymbols bool) (_ []*SearchResult, err error)
Symbol is an element in the package API. A symbol can be a constant, variable, function, or type. Children contain the child symbols for this symbol. This will only be populated when the SymbolType is "Type". For example, the children of net/http.Handler are FileServer, NotFoundHandler, RedirectHandler, StripPrefix, and TimeoutHandler. Each child symbol will have ParentName set to the Name of this type. GOARCH specifies the execution architecture where the symbol appears. GOOS specifies the execution operating system where the symbol appears. SymbolMeta SymbolMeta Kind is the type of a symbol, which is either a constant, variable, function, type, field or method. Name is the name of the symbol. ParentName if name of the parent type if available, otherwise the empty string. For example, the parent type for net/http.FileServer is Handler. Section is the section that a symbol appears in. Synopsis is the one line description of the symbol as displayed in the package documentation. func golang.org/x/pkgsite/internal/godoc.(*Package).DocInfo(ctx context.Context, innerPath string, sourceInfo *source.Info, modInfo *godoc.ModuleInfo) (synopsis string, imports []string, api []*Symbol, err error) func golang.org/x/pkgsite/internal/godoc/dochtml.GetSymbols(p *doc.Package, fset *token.FileSet) (_ []*Symbol, err error) var golang.org/x/pkgsite/internal/testing/sample.Constant *Symbol var golang.org/x/pkgsite/internal/testing/sample.Function *Symbol var golang.org/x/pkgsite/internal/testing/sample.FunctionNew *Symbol var golang.org/x/pkgsite/internal/testing/sample.Type *Symbol var golang.org/x/pkgsite/internal/testing/sample.Variable *Symbol
SymbolBuildContexts represents the build contexts that are associated with a SymbolMeta. AddBuildContext adds a build context supported by this UnitSymbol. BuildContexts returns the build contexts for this UnitSymbol. InAll reports whether the unit symbol supports all build contexts. RemoveBuildContexts removes all of the build contexts associated with this unit symbol. SupportsBuild reports whether the provided build is supported by this UnitSymbol. If the build is BuildContextAll, this is interpreted as this unit symbol supports at least one build context. func (*SymbolHistory).SymbolsAtVersion(v string) map[string]map[SymbolMeta]*SymbolBuildContexts
SymbolHistory represents the history for when a symbol name was first added to a package. AddSymbol adds the given symbol to SymbolHistory. GetSymbol returns the unit symbol for a given name, version and build context. SymbolsAtVersion returns a map of name to SymbolMeta to UnitSymbol for a given version. Versions returns an array of the versions in versionToNameToUnitSymbol, sorted by increasing semver. func NewSymbolHistory() *SymbolHistory func golang.org/x/pkgsite/internal/frontend.ParseVersionsDetails(vd frontend.VersionsDetails) (_ *SymbolHistory, err error) func golang.org/x/pkgsite/internal/postgres.GetSymbolHistoryFromTable(ctx context.Context, ddb *database.DB, packagePath, modulePath string) (_ *SymbolHistory, err error) func golang.org/x/pkgsite/internal/postgres.GetSymbolHistoryWithPackageSymbols(ctx context.Context, ddb *database.DB, packagePath, modulePath string) (_ *SymbolHistory, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetSymbolHistory(ctx context.Context, packagePath, modulePath string) (_ *SymbolHistory, err error) func golang.org/x/pkgsite/internal/symbol.IntroducedHistory(sh *SymbolHistory) (outSH *SymbolHistory, err error) func golang.org/x/pkgsite/internal/symbol.CompareAPIVersions(path string, apiVersions symbol.pkgAPIVersions, inSH *SymbolHistory) ([]string, error) func golang.org/x/pkgsite/internal/symbol.IntroducedHistory(sh *SymbolHistory) (outSH *SymbolHistory, err error)
SymbolKind is the type of a symbol. const SymbolKindConstant const SymbolKindField const SymbolKindFunction const SymbolKindMethod const SymbolKindType const SymbolKindVariable
SymbolMeta is the metadata for an element in the package API. A symbol can be a constant, variable, function, or type. Kind is the type of a symbol, which is either a constant, variable, function, type, field or method. Name is the name of the symbol. ParentName if name of the parent type if available, otherwise the empty string. For example, the parent type for net/http.FileServer is Handler. Section is the section that a symbol appears in. Synopsis is the one line description of the symbol as displayed in the package documentation. func (*SymbolHistory).GetSymbol(name, v string, build BuildContext) (_ *SymbolMeta, err error) func (*SymbolHistory).SymbolsAtVersion(v string) map[string]map[SymbolMeta]*SymbolBuildContexts func (*SymbolHistory).AddSymbol(sm SymbolMeta, v string, build BuildContext)
SymbolSection is the documentation section where a symbol appears. const SymbolSectionConstants const SymbolSectionFunctions const SymbolSectionTypes const SymbolSectionVariables
Unit represents the contents of some path in the Go package/module namespace. It might be a module, a package, both a module and a package, or none of the above: a directory within a module that has no .go files, but contains other units, licenses and/or READMEs." // set only on read // at most one on read Imports []string LicenseContents []*licenses.License NumImportedBy int NumImports int Readme *Readme Subdirectories []*PackageMeta SymbolHistory is a map of symbolName to the version when the symbol was first added to the package. Symbols map[BuildContext][]*Symbol UnitMeta UnitMeta UnitMeta.IsRedistributable bool UnitMeta.Licenses []*licenses.Metadata Module level information Note: IsRedistributable (above) applies to the unit; ModuleInfo.IsRedistributable applies to the module. UnitMeta.ModuleInfo.CommitTime time.Time Deprecated describes whether the module is deprecated. DeprecationComment is the comment describing the deprecation, if any. HasGoMod describes whether the module zip has a go.mod file. UnitMeta.ModuleInfo.ModulePath string Retracted describes whether the module version is retracted. RetractionRationale is the reason for the retraction, if any. UnitMeta.ModuleInfo.SourceInfo *source.Info UnitMeta.ModuleInfo.Version string UnitMeta.Name string Unit level information IsCommand reports whether the path represents a package path. IsModule reports whether the path represents a module path. IsPackage reports whether the path represents a package path. (*T) RemoveNonRedistributableData() SeriesPath returns the series path for the module. A series is a group of modules that share the same base path and are assumed to be major-version variants. The series path is the module path without the version. For most modules, this will be the module path for all module versions with major version 0 or 1. For gopkg.in modules, the series path does not correspond to any module version. Examples: The module paths "a/b" and "a/b/v2" both have series path "a/b". The module paths "gopkg.in/yaml.v1" and "gopkg.in/yaml.v2" both have series path "gopkg.in/yaml". func DataSource.GetUnit(ctx context.Context, pathInfo *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func (*Module).Packages() []*Unit func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetUnit(ctx context.Context, pathInfo *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetUnit(ctx context.Context, um *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetUnit(ctx context.Context, um *UnitMeta, field FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/testing/sample.UnitEmpty(path, modulePath, version string) *Unit func golang.org/x/pkgsite/internal/testing/sample.UnitForModuleRoot(m *ModuleInfo) *Unit func golang.org/x/pkgsite/internal/testing/sample.UnitForPackage(path, modulePath, version, name string, isRedistributable bool) *Unit func golang.org/x/pkgsite/internal/frontend.ProcessReadme(ctx context.Context, u *Unit) (_ *frontend.Readme, err error) func golang.org/x/pkgsite/internal/godoc.RenderFromUnit(ctx context.Context, u *Unit) (_ *dochtml.Parts, err error) func golang.org/x/pkgsite/internal/testing/sample.AddPackage(m *Module, pkg *Unit) *Module func golang.org/x/pkgsite/internal/testing/sample.AddUnit(m *Module, u *Unit)
UnitMeta represents metadata about a unit. IsRedistributable bool Licenses []*licenses.Metadata Module level information Note: IsRedistributable (above) applies to the unit; ModuleInfo.IsRedistributable applies to the module. ModuleInfo.CommitTime time.Time Deprecated describes whether the module is deprecated. DeprecationComment is the comment describing the deprecation, if any. HasGoMod describes whether the module zip has a go.mod file. ModuleInfo.ModulePath string Retracted describes whether the module version is retracted. RetractionRationale is the reason for the retraction, if any. ModuleInfo.SourceInfo *source.Info ModuleInfo.Version string Name string Unit level information IsCommand reports whether the path represents a package path. IsModule reports whether the path represents a module path. IsPackage reports whether the path represents a package path. SeriesPath returns the series path for the module. A series is a group of modules that share the same base path and are assumed to be major-version variants. The series path is the module path without the version. For most modules, this will be the module path for all module versions with major version 0 or 1. For gopkg.in modules, the series path does not correspond to any module version. Examples: The module paths "a/b" and "a/b/v2" both have series path "a/b". The module paths "gopkg.in/yaml.v1" and "gopkg.in/yaml.v2" both have series path "gopkg.in/yaml". func DataSource.GetUnitMeta(ctx context.Context, path, requestedModulePath, requestedVersion string) (_ *UnitMeta, err error) func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetUnitMeta(ctx context.Context, path, requestedModulePath, requestedVersion string) (_ *UnitMeta, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetUnitMeta(ctx context.Context, fullPath, requestedModulePath, requestedVersion string) (_ *UnitMeta, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetUnitMeta(ctx context.Context, path, inModulePath, inVersion string) (_ *UnitMeta, err error) func golang.org/x/pkgsite/internal/testing/sample.UnitMeta(path, modulePath, version, name string, isRedistributable bool) *UnitMeta func DataSource.GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) (LatestInfo, error) func DataSource.GetUnit(ctx context.Context, pathInfo *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/frontend.(*Server).GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) LatestInfo func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) (LatestInfo, error) func golang.org/x/pkgsite/internal/localdatasource.(*DataSource).GetUnit(ctx context.Context, pathInfo *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) (latest LatestInfo, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetUnit(ctx context.Context, um *UnitMeta, fields FieldSet, bc BuildContext) (_ *Unit, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *UnitMeta) (latest LatestInfo, err error) func golang.org/x/pkgsite/internal/proxydatasource.(*DataSource).GetUnit(ctx context.Context, um *UnitMeta, field FieldSet, bc BuildContext) (_ *Unit, err error)
VersionMap holds metadata associated with module queries for a version. Error string GoModPath string ModulePath string RequestedVersion string ResolvedVersion string Status int UpdatedAt time.Time func golang.org/x/pkgsite/internal/postgres.(*DB).GetVersionMap(ctx context.Context, modulePath, requestedVersion string) (_ *VersionMap, err error) func golang.org/x/pkgsite/internal/postgres.(*DB).GetVersionMaps(ctx context.Context, paths []string, requestedVersion string) (_ []*VersionMap, err error) func golang.org/x/pkgsite/internal/testing/sample.DefaultVersionMap() *VersionMap func golang.org/x/pkgsite/internal/postgres.(*DB).UpsertVersionMap(ctx context.Context, vm *VersionMap) (err error)
Package-Level Functions (total 12, in which 10 are exported)
CandidateModulePaths returns the potential module paths that could contain the fullPath, from longest to shortest. It returns nil if no valid module paths can be constructed.
CompareBuildContexts returns a negative number, 0, or a positive number depending on the relative positions of c1 and c2 in BuildContexts.
DocumentationForBuildContext returns the first Documentation the list that matches the BuildContext, or nil if none does. A Documentation matches if its GOOS and GOARCH fields are the same as those of the BuildContext, or if the Documentation field is "all", or if the BuildContext field is empty. That is, empty BuildContext fields act as wildcards. So the zero BuildContext will match the first element of docs, if there is one.
MajorVersionForModule returns the final "vN" from the module path, if any. It returns the empty string if the module path is malformed. Examples: "m.com" => "" "m.com/v2" => "v2" "gpkg.in/m.v1 = "v1"
func NewLatestModuleVersions(modulePath, raw, cooked, good string, modBytes []byte) (*LatestModuleVersions, error)
NewSymbolHistory returns a new *SymbolHistory.
SeriesPathAndMajorVersion splits modulePath into a series path and a numeric major version. If the path doesn't have a "vN" suffix, it returns 1. If the module path is invalid, it returns ("", 0).
SeriesPathForModule returns the series path for the provided modulePath.
Suffix returns the suffix of the fullPath. It assumes that basePath is a prefix of fullPath. If fullPath and basePath are the same, the empty string is returned.
V1Path returns the path for version 1 of the package whose import path is fullPath. If modulePath is the standard library, then V1Path returns fullPath.
Package-Level Variables (total 9, in which 8 are exported)
BuildContexts are the build contexts we check when loading a package (see internal/fetch/load.go). We store documentation for all of the listed contexts. The order determines which environment's docs we will show as the default.
DefaultBranches are default branches that are supported by pkgsite.
Experiments represents all of the active experiments in the codebase and a description of each experiment.
Package-Level Constants (total 29, all are exported)
All represents all values for a build context element (GOOS or GOARCH).
AllFields is the FieldSet that contains all fields.
const ExperimentDeprecatedDoc = "deprecated-doc"
const ExperimentInsertSymbolSearchDocuments = "insert-symbol-search-documents"
const ExperimentReadSymbolHistory = "read-symbol-history"
const ExperimentSearchGrouping = "search-grouping"
const ExperimentStyleGuide = "styleguide"
const ExperimentSymbolHistoryMainPage = "symbol-history-main-page"
const ExperimentSymbolHistoryVersionsPage = "symbol-history-versions-page"
const ExperimentSymbolSearch = "symbol-search"
LatestVersion signifies the latest available version in requests to the proxy client.
MainVersion represents the main branch.
MasterVersion represents the master branch.
MinimalFields is the empty FieldSet.
StringFieldMissing is the value for string fields that are not present in a struct. We use it to distinguish a (possibly valid) empty string from a field that was never populated.
UnknownModulePath signifies that the module path for a given package path is ambiguous or not known. This is because requests to the frontend can come in the form of <import-path>[@<version>], and it is not clear which part of the import-path is the module path.
FieldSet bits for fields that can be conditionally read from the data store.
FieldSet bits for fields that can be conditionally read from the data store.
FieldSet bits for fields that can be conditionally read from the data store.