Documentation
¶
Index ¶
- Constants
- func GetDefaultCacheBasePath() (string, error)
- func ReadGoMod(content []byte) (mainModule *Module, modules []*Module, err error)
- type Cache
- type DepsDevClient
- type GitCmd
- type GitCmdI
- type GitHandler
- func (g *GitHandler) CanHandle(path string) (bool, error)
- func (g *GitHandler) GetInfo(path string, version *semver.Version) (*Module, error)
- func (g *GitHandler) GetLatestInfo(path string) (*Module, error)
- func (g *GitHandler) GetModFile(path string, version *semver.Version) ([]byte, error)
- func (g *GitHandler) GetVersions(path string) ([]*semver.Version, error)
- func (g *GitHandler) Name() string
- type GoListExecutor
- func (e *GoListExecutor) GetInfo(path string, version *semver.Version) (*Module, error)
- func (e *GoListExecutor) GetLatestInfo(path string) (*Module, error)
- func (e *GoListExecutor) GetModFile(_ string, _ *semver.Version) ([]byte, error)
- func (e *GoListExecutor) GetVersions(path string) ([]*semver.Version, error)
- type GoProxyClient
- func (c *GoProxyClient) GetInfo(path string, version *semver.Version) (*Module, error)
- func (c *GoProxyClient) GetLatestInfo(path string) (*Module, error)
- func (c *GoProxyClient) GetModFile(path string, version *semver.Version) ([]byte, error)
- func (c *GoProxyClient) GetVersions(path string) ([]*semver.Version, error)
- type Module
- type VersionsDiff
Constants ¶
View Source
const ProgramName = "go-libyear"
Variables ¶
This section is empty.
Functions ¶
func GetDefaultCacheBasePath ¶
Types ¶
type DepsDevClient ¶
type DepsDevClient struct {
// contains filtered or unexported fields
}
func NewDepsDevClient ¶
func NewDepsDevClient() *DepsDevClient
func (DepsDevClient) GetVersions ¶
func (c DepsDevClient) GetVersions(path string) ([]*semver.Version, error)
type GitHandler ¶
type GitHandler struct {
// contains filtered or unexported fields
}
GitHandler is a module handler for git version control system.
func NewGitVCS ¶
func NewGitVCS(cacheDir string, git GitCmdI) *GitHandler
func (*GitHandler) GetLatestInfo ¶
func (g *GitHandler) GetLatestInfo(path string) (*Module, error)
func (*GitHandler) GetModFile ¶
func (*GitHandler) GetVersions ¶
func (g *GitHandler) GetVersions(path string) ([]*semver.Version, error)
func (*GitHandler) Name ¶
func (g *GitHandler) Name() string
type GoListExecutor ¶
type GoListExecutor struct {
// contains filtered or unexported fields
}
func NewGoListExecutor ¶
func NewGoListExecutor(useCache bool, cacheFilePath string) (*GoListExecutor, error)
func (*GoListExecutor) GetLatestInfo ¶
func (e *GoListExecutor) GetLatestInfo(path string) (*Module, error)
func (*GoListExecutor) GetModFile ¶
func (*GoListExecutor) GetVersions ¶
func (e *GoListExecutor) GetVersions(path string) ([]*semver.Version, error)
type GoProxyClient ¶
type GoProxyClient struct {
// contains filtered or unexported fields
}
GoProxyClient is used to interact with Golang proxy server. Details on GOPROXY protocol can be found here: https://go.dev/ref/mod#goproxy-protocol.
func NewGoProxyClient ¶
func NewGoProxyClient(useCache bool, cacheFilePath string) (*GoProxyClient, error)
func (*GoProxyClient) GetLatestInfo ¶
func (c *GoProxyClient) GetLatestInfo(path string) (*Module, error)
func (*GoProxyClient) GetModFile ¶
func (*GoProxyClient) GetVersions ¶
func (c *GoProxyClient) GetVersions(path string) ([]*semver.Version, error)
type Module ¶
type Module struct { Path string `json:"Path"` Version *semver.Version `json:"Version"` Time time.Time `json:"Time"` Indirect bool `json:"-"` Skipped bool `json:"-"` Latest *Module `json:"-"` Libyear float64 `json:"-"` // ReleasesDiff is the number of release versions between latest and current. ReleasesDiff int `json:"-"` // VersionsDiff is an array of 3 elements: major, minor and patch versions. VersionsDiff VersionsDiff `json:"-"` // AllPaths preceding this version, if any. // This field is only set for latest version. AllPaths []string `json:"-"` }
Module is a container used to decode GOPROXY and 'go list' responses and transport calculated metrics.
type VersionsDiff ¶
type VersionsDiff [3]int64
func (VersionsDiff) Add ¶
func (v VersionsDiff) Add(y VersionsDiff) VersionsDiff
func (VersionsDiff) String ¶
func (v VersionsDiff) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.