Documentation ¶
Index ¶
- func GetAllModules(workspaceRoot string) util.OrderedMap[string, Module]
- func SetupModule(modulePath string)
- func WriteModuleFile(modulePath string, moduleFile ModuleFile)
- type Dependency
- type GitMirror
- type GitModule
- func (m GitModule) Checkout(ref string)
- func (m GitModule) Fetch() bool
- func (m GitModule) GetCommitAuthorName(revision string) (string, error)
- func (m GitModule) GetCommitTitle(revision string) (string, error)
- func (m GitModule) GetCommitsBetweenRefs(base, head string) ([]string, error)
- func (m GitModule) GetMergeBase(revA, revB string) (string, error)
- func (m GitModule) Head() string
- func (m GitModule) IsAncestor(ancestor, rev string) bool
- func (m GitModule) IsDirty() bool
- func (m GitModule) Mirror() *GitMirror
- func (m GitModule) Name() string
- func (m GitModule) RevParse(ref string) string
- func (m GitModule) RootPath() string
- func (m GitModule) Type() ModuleType
- func (m GitModule) URL() string
- type GoFile
- type GoModule
- type Module
- type ModuleFile
- type ModuleType
- type TarMirror
- type TarModule
- func (m TarModule) Checkout(hash string)
- func (m TarModule) Fetch() bool
- func (m TarModule) Head() string
- func (m TarModule) IsAncestor(ancestor, rev string) bool
- func (m TarModule) IsDirty() bool
- func (m TarModule) Name() string
- func (m TarModule) RevParse(rev string) string
- func (m TarModule) RootPath() string
- func (m TarModule) Type() ModuleType
- func (m TarModule) URL() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllModules ¶ added in v2.0.2
func GetAllModules(workspaceRoot string) util.OrderedMap[string, Module]
GetAllModules return all the names and modules in the workspace
func SetupModule ¶
func SetupModule(modulePath string)
SetupModule runs the SETUP.go file in the root directory of `mod` (it if exists).
func WriteModuleFile ¶
func WriteModuleFile(modulePath string, moduleFile ModuleFile)
WriteModuleFile serializes and writes a Module's Dependencies to a MODULE file.
Types ¶
type GitMirror ¶ added in v2.0.2
type GitMirror struct {
// contains filtered or unexported fields
}
GitMirror is a bare repository that backs a GitModule
type GitModule ¶
type GitModule struct {
// contains filtered or unexported fields
}
GitModule is a module backed by a git repository.
func (GitModule) Fetch ¶
Fetch fetches changes from the default remote and reports whether any updates have been fetched.
func (GitModule) GetCommitAuthorName ¶ added in v2.0.2
func (GitModule) GetCommitTitle ¶ added in v2.0.2
func (GitModule) GetCommitsBetweenRefs ¶ added in v2.0.2
func (GitModule) GetMergeBase ¶ added in v2.0.2
GetMergeBase returns the best common ancestor that could be used for a merge between the two given references.
func (GitModule) IsAncestor ¶ added in v2.0.2
IsAncestor returns whether ancestor is an ancestor of rev in the commit tree.
func (GitModule) IsDirty ¶
IsDirty returns whether the underlying repository has any uncommited changes.
func (GitModule) Type ¶ added in v2.0.2
func (m GitModule) Type() ModuleType
type GoFile ¶ added in v2.0.2
type GoFile struct { // Absolute path to file SourcePath string // Relatve path from go root CopyPath string }
func ListBuildFiles ¶ added in v2.0.2
type GoModule ¶ added in v2.0.2
func ListGoModules ¶ added in v2.0.2
type Module ¶
type Module interface { Name() string URL() string Head() string RevParse(rev string) string IsDirty() bool IsAncestor(ancestor, rev string) bool Fetch() bool Checkout(hash string) RootPath() string Type() ModuleType }
Module represents a checked-out module.
func CreateGitModule ¶ added in v2.0.2
createGitModule creates a new GitModule in the given `modulePath` by cloning the repository from `url`.
func OpenModule ¶
OpenModule opens a module checked out on disk.
func OpenModuleByName ¶ added in v2.0.2
OpenModuleByName opens a module checked out on disk.
func OpenOrCreateModule ¶
func OpenOrCreateModule(modulePath string, url string, moduleTypeString string, expectedHash string) Module
OpenOrCreateModule tries to open the module in `modulePath`. If the `modulePath` directory does not yet exists, it tries to create a new module by cloning / downloading the module from `url`.
type ModuleFile ¶
type ModuleFile struct { Version uint Layout string Dependencies map[string]Dependency Flags map[string]string PersistFlags *bool `yaml:"persist-flags,omitempty"` }
func ReadModuleFile ¶
func ReadModuleFile(modulePath string) ModuleFile
ReadModuleFile reads and parses module Dependencies from a MODULE file.
type ModuleType ¶ added in v2.0.2
type ModuleType uint
const ( GitModuleType ModuleType = iota TarGzModuleType )
func DetermineModuleType ¶ added in v2.0.2
func DetermineModuleType(url, moduleTypeString string) ModuleType
func ParseModuleTypeString ¶ added in v2.0.2
func ParseModuleTypeString(str string) (ModuleType, bool)
func (ModuleType) String ¶ added in v2.0.2
func (t ModuleType) String() string
type TarMirror ¶ added in v2.0.2
type TarMirror struct {
// contains filtered or unexported fields
}
type TarModule ¶
type TarModule struct {
// contains filtered or unexported fields
}
TarModule is a module backed by a tar.gz archive. TarModules only have a single "master" version.
func (TarModule) Checkout ¶
Checkout changes the module's current version to `ref`. TarModules only have a single version. Attempting to check out any other version results in an error.
func (TarModule) Fetch ¶
Fetch does nothing on TarModules and reports that no changes have been fetched.
func (TarModule) IsAncestor ¶ added in v2.0.2
func (TarModule) IsDirty ¶
IsDirty returns whether the module has any uncommited changes. TarModules never have any uncommited changes by definition.
func (TarModule) Type ¶ added in v2.0.2
func (m TarModule) Type() ModuleType