Documentation ¶
Index ¶
- Constants
- func IsValidVersion(version string) bool
- func VerifyGoVersion(minimumGoVersion string) error
- type DownloadModule
- type GoMod
- type GomodHelper
- func (g *GomodHelper) EditDropreplace(path string) error
- func (g *GomodHelper) EditReplace(oldPath, newPath, version string) error
- func (g *GomodHelper) EditRequire(path, version string) error
- func (g *GomodHelper) Format() error
- func (g *GomodHelper) ModDownload(path, version string) (*DownloadModule, error)
- func (g *GomodHelper) ModTidy() error
- func (g *GomodHelper) ParseListMod() ([]ListModule, error)
- func (g *GomodHelper) ParseMod() (*GoMod, error)
- func (g *GomodHelper) PruneAndTidy() error
- func (g *GomodHelper) Replace(oldPath, newPath, version string) error
- func (g *GomodHelper) Require(path, version string, skipDeps bool) error
- type ListModule
- type ModModule
- type ModeEditVerb
- type ModuleError
- type Replace
- type Require
Constants ¶
View Source
const (
MinimumGoVersion = "1.13.0"
)
Variables ¶
This section is empty.
Functions ¶
func IsValidVersion ¶
func VerifyGoVersion ¶
Types ¶
type DownloadModule ¶
type DownloadModule struct { Path string // module path Version string // module version Error string // error loading module Info string // absolute path to cached .info file GoMod string // absolute path to cached .mod file Zip string // absolute path to cached .zip file Dir string // absolute path to cached source root directory Sum string // checksum for path, version (as in go.sum) GoModSum string // checksum for go.mod (as in go.sum) }
type GomodHelper ¶
type GomodHelper struct {
// contains filtered or unexported fields
}
func NewGomodHelper ¶
func NewGomodHelper(modfile string, logger logr.Logger) *GomodHelper
func (*GomodHelper) EditDropreplace ¶
func (g *GomodHelper) EditDropreplace(path string) error
func (*GomodHelper) EditReplace ¶
func (g *GomodHelper) EditReplace(oldPath, newPath, version string) error
func (*GomodHelper) EditRequire ¶
func (g *GomodHelper) EditRequire(path, version string) error
func (*GomodHelper) Format ¶
func (g *GomodHelper) Format() error
func (*GomodHelper) ModDownload ¶
func (g *GomodHelper) ModDownload(path, version string) (*DownloadModule, error)
func (*GomodHelper) ModTidy ¶
func (g *GomodHelper) ModTidy() error
func (*GomodHelper) ParseListMod ¶
func (g *GomodHelper) ParseListMod() ([]ListModule, error)
func (*GomodHelper) ParseMod ¶
func (g *GomodHelper) ParseMod() (*GoMod, error)
func (*GomodHelper) PruneAndTidy ¶
func (g *GomodHelper) PruneAndTidy() error
PruneAndTidy 1. ensures all existing 'require' directives have an associated 'replace' directive pinning a version
- adds explicit 'require' directives for all transitive dependencies
- adds explicit 'replace' directives for all require directives
2. prune replace directives that pin to the naturally selected version. 3. format and tidy go.mod
func (*GomodHelper) Replace ¶
func (g *GomodHelper) Replace(oldPath, newPath, version string) error
type ListModule ¶
type ListModule struct { Path string // module path Version string // module version Versions []string // available module versions (with -versions) Replace *ListModule // replaced by this module Time *time.Time // time version was created Update *ListModule // available update, if any (with -u) Main bool // is this the main module? Indirect bool // is this module only an indirect dependency of main module? Dir string // directory holding files for this module, if any GoMod string // path to go.mod file used when loading this module, if any GoVersion string // go version used in module Error *ModuleError // error loading module }
type ModeEditVerb ¶
type ModeEditVerb string
const ( EditRequire ModeEditVerb = "require" EditReplace ModeEditVerb = "replace" EditDropreplace ModeEditVerb = "dropreplace" )
type ModuleError ¶
type ModuleError struct {
Err string // the error itself
}
Click to show internal directories.
Click to hide internal directories.