Documentation
¶
Index ¶
- Constants
- func FetchWithCache(investigator investigator.SourceInvestigator, packagePath string, ...) (source.Data, error)
- type CratesIOInvestigator
- type ErrCode
- type GitHubInvestigator
- type GitLabInvestigator
- type GoMetadata
- type GoPkgDevInvestigator
- type JSRInvestigator
- type NPMInvestigator
- type PackagistInvestigator
- type PyPIInvestigator
- type RubyGemsInvestigator
- type WebsiteInvestigator
Constants ¶
const ( // ErrGLabCommandNotFound represents an error when the glab command is not found ErrGLabCommandNotFound ErrCode = "GLabCommandNotFound" // ErrGLabCommandFailed represents an error when the glab command fails ErrGLabCommandFailed ErrCode = "GLabCommandFailed" // EnvGLabCommand is the environment variable name for specifying glab command path EnvGLabCommand = "MIRU_GLAB_BIN" // DefaultGLabCommand is the default command name for GitLab CLI DefaultGLabCommand = "glab" )
Variables ¶
This section is empty.
Functions ¶
func FetchWithCache ¶
func FetchWithCache(investigator investigator.SourceInvestigator, packagePath string, forceUpdate bool) (source.Data, error)
FetchWithCache fetches data from the source with cache support It uses the cache.GetOrSet function to retrieve data from cache or fetch it if not available The cache key is generated from the investigator type and package path The forceUpdate parameter can be used to ignore the cache and fetch fresh data
Types ¶
type CratesIOInvestigator ¶
type CratesIOInvestigator struct{}
Implementation of CratesIO Investigator
func (*CratesIOInvestigator) Fetch ¶
func (i *CratesIOInvestigator) Fetch(packagePath string) (source.Data, error)
func (*CratesIOInvestigator) GetSourceType ¶
func (i *CratesIOInvestigator) GetSourceType() source.Type
func (*CratesIOInvestigator) GetURL ¶
func (i *CratesIOInvestigator) GetURL(packagePath string) string
func (*CratesIOInvestigator) PackageFromURL ¶
func (i *CratesIOInvestigator) PackageFromURL(url string) (string, error)
type ErrCode ¶
type ErrCode string
const ( // ErrGHCommandNotFound represents an error when the gh command is not found ErrGHCommandNotFound ErrCode = "GHCommandNotFound" // ErrGHCommandFailed represents an error when the gh command fails ErrGHCommandFailed ErrCode = "GHCommandFailed" // ErrREADMENotFound represents an error when README is not found ErrREADMENotFound ErrCode = "READMENotFound" // EnvGHCommand is the environment variable name for specifying gh command path EnvGHCommand = "MIRU_GH_BIN" // DefaultGHCommand is the default command name for GitHub CLI DefaultGHCommand = "gh" )
const (
ErrInvalidPackagePath ErrCode = "InvalidPackagePath"
)
const ( // ErrNPMREADMENotFound represents an error when README is not found ErrNPMREADMENotFound ErrCode = "NPMREADMENotFound" )
const ( // ErrPackagistREADMENotFound represents an error when README is not found ErrPackagistREADMENotFound ErrCode = "PackagistREADMENotFound" )
const (
ErrPkgGoDevREADMENotFound ErrCode = "ErrPkgGoDevREADMENotFound"
)
const ( // ErrPyPIREADMENotFound represents an error when README is not found ErrPyPIREADMENotFound ErrCode = "PyPIREADMENotFound" )
const ( // ErrRubyGemsREADMENotFound represents an error when README is not found ErrRubyGemsREADMENotFound ErrCode = "RubyGemsREADMENotFound" )
type GitHubInvestigator ¶
type GitHubInvestigator struct{}
Implementation of GitHub Investigator
func (*GitHubInvestigator) Fetch ¶
func (i *GitHubInvestigator) Fetch(packagePath string) (source.Data, error)
func (*GitHubInvestigator) GetSourceType ¶
func (i *GitHubInvestigator) GetSourceType() source.Type
func (*GitHubInvestigator) GetURL ¶
func (i *GitHubInvestigator) GetURL(packagePath string) string
func (*GitHubInvestigator) PackageFromURL ¶
func (i *GitHubInvestigator) PackageFromURL(url string) (string, error)
type GitLabInvestigator ¶
type GitLabInvestigator struct{}
Implementation of GitLab Investigator
func (*GitLabInvestigator) Fetch ¶
func (i *GitLabInvestigator) Fetch(packagePath string) (source.Data, error)
func (*GitLabInvestigator) GetSourceType ¶
func (i *GitLabInvestigator) GetSourceType() source.Type
func (*GitLabInvestigator) GetURL ¶
func (i *GitLabInvestigator) GetURL(packagePath string) string
func (*GitLabInvestigator) PackageFromURL ¶
func (i *GitLabInvestigator) PackageFromURL(url string) (string, error)
type GoMetadata ¶
type GoMetadata struct {
Repository *url.URL // Repository URL from go-import meta tag
Homepage *url.URL // Homepage URL from go-source meta tag
}
GoMetadata contains metadata extracted from go-import and go-source meta tags
type GoPkgDevInvestigator ¶
type GoPkgDevInvestigator struct{}
Implementation of GoPkgDev Investigator
func (*GoPkgDevInvestigator) Fetch ¶
func (i *GoPkgDevInvestigator) Fetch(packagePath string) (source.Data, error)
func (*GoPkgDevInvestigator) GetSourceType ¶
func (i *GoPkgDevInvestigator) GetSourceType() source.Type
func (*GoPkgDevInvestigator) GetURL ¶
func (i *GoPkgDevInvestigator) GetURL(packagePath string) string
func (*GoPkgDevInvestigator) PackageFromURL ¶
func (i *GoPkgDevInvestigator) PackageFromURL(url string) (string, error)
type JSRInvestigator ¶
type JSRInvestigator struct{}
Implementation of JSR Investigator
func (*JSRInvestigator) Fetch ¶
func (i *JSRInvestigator) Fetch(packagePath string) (source.Data, error)
func (*JSRInvestigator) GetSourceType ¶
func (i *JSRInvestigator) GetSourceType() source.Type
func (*JSRInvestigator) GetURL ¶
func (i *JSRInvestigator) GetURL(packagePath string) string
func (*JSRInvestigator) PackageFromURL ¶
func (i *JSRInvestigator) PackageFromURL(url string) (string, error)
type NPMInvestigator ¶
type NPMInvestigator struct{}
Implementation of NPM Investigator
func (*NPMInvestigator) Fetch ¶
func (i *NPMInvestigator) Fetch(packagePath string) (source.Data, error)
func (*NPMInvestigator) GetSourceType ¶
func (i *NPMInvestigator) GetSourceType() source.Type
func (*NPMInvestigator) GetURL ¶
func (i *NPMInvestigator) GetURL(packagePath string) string
func (*NPMInvestigator) PackageFromURL ¶
func (i *NPMInvestigator) PackageFromURL(url string) (string, error)
type PackagistInvestigator ¶
type PackagistInvestigator struct{}
Implementation of Packagist Investigator
func (*PackagistInvestigator) Fetch ¶
func (i *PackagistInvestigator) Fetch(packagePath string) (source.Data, error)
func (*PackagistInvestigator) GetSourceType ¶
func (i *PackagistInvestigator) GetSourceType() source.Type
func (*PackagistInvestigator) GetURL ¶
func (i *PackagistInvestigator) GetURL(packagePath string) string
func (*PackagistInvestigator) PackageFromURL ¶
func (i *PackagistInvestigator) PackageFromURL(url string) (string, error)
type PyPIInvestigator ¶
type PyPIInvestigator struct{}
Implementation of PyPI Investigator
func (*PyPIInvestigator) Fetch ¶
func (i *PyPIInvestigator) Fetch(packagePath string) (source.Data, error)
func (*PyPIInvestigator) GetSourceType ¶
func (i *PyPIInvestigator) GetSourceType() source.Type
func (*PyPIInvestigator) GetURL ¶
func (i *PyPIInvestigator) GetURL(packagePath string) string
func (*PyPIInvestigator) PackageFromURL ¶
func (i *PyPIInvestigator) PackageFromURL(url string) (string, error)
type RubyGemsInvestigator ¶
type RubyGemsInvestigator struct{}
Implementation of RubyGems Investigator
func (*RubyGemsInvestigator) Fetch ¶
func (i *RubyGemsInvestigator) Fetch(packagePath string) (source.Data, error)
func (*RubyGemsInvestigator) GetSourceType ¶
func (i *RubyGemsInvestigator) GetSourceType() source.Type
func (*RubyGemsInvestigator) GetURL ¶
func (i *RubyGemsInvestigator) GetURL(packagePath string) string
func (*RubyGemsInvestigator) PackageFromURL ¶
func (i *RubyGemsInvestigator) PackageFromURL(url string) (string, error)
type WebsiteInvestigator ¶
Implementation of Website Investigator
func (*WebsiteInvestigator) Fetch ¶
func (i *WebsiteInvestigator) Fetch(packagePath string) (source.Data, error)
func (*WebsiteInvestigator) GetSourceType ¶
func (i *WebsiteInvestigator) GetSourceType() source.Type
func (*WebsiteInvestigator) GetURL ¶
func (i *WebsiteInvestigator) GetURL(packagePath string) string
func (*WebsiteInvestigator) PackageFromURL ¶
func (i *WebsiteInvestigator) PackageFromURL(url string) (string, error)