Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
Source Reference
Contents map[string]string
// Metadata is metadata retrieved from the source
Metadata map[string]any
// BrowserURL is URL that accesible with web browser
BrowserURL *url.URL
FetchError error
// FetchedAt is the time when the data was retrieved
FetchedAt time.Time
// RelatedSources are sources related to this data
RelatedSources []RelatedReference
}
Data is a structure that represents data retrieved from a specific source
type RelatedReference ¶
type RelatedReference struct {
// Type represents the source type (e.g., SourceTypeGoPkgDev) or SourceType*
Type Type
Path string
// URL represents the complete URL to the documentation
URL string
// From indicates how this source was discovered: "api", or "document"
From string
}
RelatedReference represents a related documentation source found in content or API responses
func (RelatedReference) ToSourceReference ¶
func (s RelatedReference) ToSourceReference() Reference
type Type ¶
type Type string
Type represents the type of documentation source
const ( // Documentation source types TypeGoPkgDev Type = "pkg.go.dev" TypeJSR Type = "jsr.io" TypeNPM Type = "npmjs.com" TypeCratesIO Type = "crates.io" TypeRubyGems Type = "rubygems.org" TypePyPI Type = "pypi.org" TypePackagist Type = "packagist.org" TypeGitHub Type = "github.com" TypeGitLab Type = "gitlab.com" TypeDocumentation Type = "documentation" TypeHomepage Type = "homepage" TypeUnknown Type = "" )
func DetectSourceTypeFromURL ¶
detectSourceTypeFromURL detects the source type from a URL
func SourceTypeFromString ¶
SourceTypeFromString creates a SourceType from a string
func (Type) ContainRepositoryURL ¶
func (Type) IsDocumentation ¶
func (Type) IsRegistry ¶
IsRegistry returns true if the source type is a package registry
func (Type) IsRepository ¶
IsRepository returns true if the source type is a code repository
Click to show internal directories.
Click to hide internal directories.