Documentation ¶
Index ¶
- type Modder
- func (mdr *Modder) CheckForErrors() error
- func (mdr *Modder) CompareLocalReplaceToVendor(R Replace) error
- func (mdr *Modder) CompareSumEntryToVendor(R Replace) error
- func (mdr *Modder) Graph() error
- func (mdr *Modder) GraphMVS() error
- func (mdr *Modder) Init(module string) error
- func (mdr *Modder) LoadLocalReplace(R Replace) error
- func (mdr *Modder) LoadMappingsFile() error
- func (mdr *Modder) LoadMetaFromBilly() error
- func (mdr *Modder) LoadMetaFromFS(dir string) error
- func (mdr *Modder) LoadMetaFromZip() error
- func (mdr *Modder) LoadModFile() error
- func (mdr *Modder) LoadRemoteModule(R Replace) error
- func (mdr *Modder) LoadRootDeps() error
- func (mdr *Modder) LoadSumFile() error
- func (mdr *Modder) MvsMergeDependency(m *Module) error
- func (mdr *Modder) PartitionSumEntries() ([]string, []string, []string, error)
- func (mdr *Modder) PrintErrors() error
- func (mdr *Modder) PrintRootDeps() error
- func (mdr *Modder) ReplaceDependency(m *Module) error
- func (mdr *Modder) Status() error
- func (mdr *Modder) StatusMVS() error
- func (mdr *Modder) Tidy() error
- func (mdr *Modder) TidyMVS() error
- func (mdr *Modder) Vendor() error
- func (mdr *Modder) VendorDep(R Replace) error
- func (mdr *Modder) VendorMVS() error
- func (mdr *Modder) Verify() error
- func (mdr *Modder) VerifyMVS() error
- func (mdr *Modder) WriteVendor() error
- type Module
- func (m *Module) LoadMappingFile(fn string) error
- func (m *Module) LoadMetaFiles(modname, sumname, mapname string, ignoreReplace bool) error
- func (m *Module) LoadModFile(fn string, ignoreReplace bool) error
- func (mod *Module) LoadSelfDeps() error
- func (m *Module) LoadSumFile(fn string) error
- func (m *Module) MergeSelfDeps(ignoreReplace bool) error
- func (mod *Module) PrintSelfDeps() error
- type Replace
- type Require
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Modder ¶
type Modder struct { // MetaConfiguration Name string `yaml:"Name"` Version string `yaml:"Version",omitempty` // Module information ModFile string `yaml:"ModFile",omitempty` SumFile string `yaml:"SumFile",omitempty` ModsDir string `yaml:"ModsDir",omitempty` MappingFile string `yaml:"MappingFile",omitempty` // Commands override default, configuragble processing // for things like golang NoLoad bool `yaml:"NoLoad",omitempty` CommandInit [][]string `yaml:"CommandInit",omitempty` CommandGraph [][]string `yaml:"CommandGraph",omitempty` CommandTidy [][]string `yaml:"CommandTidy",omitempty` CommandVendor [][]string `yaml:"CommandVendor",omitempty` CommandVerify [][]string `yaml:"CommandVerify",omitempty` CommandStatus [][]string `yaml:"CommandStatus",omitempty` // Init related fields // we need to create things like directories and files beyond the InitTemplates map[string]string `yaml:"InitTemplates",omitempty` InitPreCommands [][]string `yaml:"InitPreCommands",omitempty` InitPostCommands [][]string `yaml:"InitPostCommands",omitempty` // Vendor related fields // filesystem globs for discovering files we should copy over VendorIncludeGlobs []string `yaml:"VendorIncludeGlobs",omitempty` VendorExcludeGlobs []string `yaml:"VendorExcludeGlobs",omitempty` // Any files we need to generate VendorTemplates map[string]string `yaml:"VendorTemplates",omitempty` VendorPreCommands [][]string `yaml:"VendorPreCommands",omitempty` VendorPostCommands [][]string `yaml:"VendorPostCommands",omitempty` // Some more vendor controls ManageFileOnly bool `yaml:"ManageFileOnly",omitempty` SymlinkLocalReplaces bool `yaml:"SymlinkLocalReplaces",omitempty` // Introspection Configuration(s) // filesystem globs for discovering files we should introspect // regexs for extracting package information IntrospectIncludeGlobs []string `yaml:"IntrospectIncludeGlobs",omitempty` IntrospectExcludeGlobs []string `yaml:"IntrospectExcludeGlobs",omitempty` IntrospectExtractRegex []string `yaml:"IntrospectExtractRegex",omitempty` PackageManagerDefaultPrefix string `yaml:"PackageManagerDefaultPrefix",omitempty` // filesystem FS billy.Filesystem `yaml:"-"` // compiled cue, used for merging CueInstance *cue.Instance `yaml:"-"` // contains filtered or unexported fields }
This modder is for more complex, yet configurable module processing. You can have system wide and local custom configurations. The fields in this struct are alpha and are likely to change
func NewFromFile ¶
func (*Modder) CheckForErrors ¶
func (*Modder) CompareLocalReplaceToVendor ¶
func (*Modder) CompareSumEntryToVendor ¶
func (*Modder) LoadLocalReplace ¶
func (*Modder) LoadMappingsFile ¶
Loads the root modules mapping file
func (*Modder) LoadMetaFromBilly ¶
func (*Modder) LoadMetaFromFS ¶
func (*Modder) LoadMetaFromZip ¶
func (*Modder) LoadRemoteModule ¶
func (*Modder) LoadRootDeps ¶
func (*Modder) MvsMergeDependency ¶
If not set, justs adds. If set, takes the one with the greater version.
func (*Modder) PartitionSumEntries ¶
func (*Modder) PrintErrors ¶
func (*Modder) PrintRootDeps ¶
func (*Modder) ReplaceDependency ¶
This sets or overwrites the module
func (*Modder) Vendor ¶
Vendor reads in a module, determines dependencies, and writes out the vendor folder.
Will there be infinite recursion, or maybe just two levels?
This module & deps
load this module a) check sum <-> mod files, need to determine if any updates here, for now w/o sum file
process its sum/mod files
for each of this mods deps dependency a) fetch all refs b) find minimum c) add to depMap, when / if ... ? guessing how right now - replaces are processed first - requires are processed second, so only add if not there, we shouldn't have duplicates in owr own mods files - d) if added, clond the desired ref to memory
Now loop over depMap to pull in secondary dependencies - probably want to create a "newDeps" map here if we need to support wider recursion - basically follow the last block, but load idependently and merge after - do we need a separate modder when we process each dep? - probably if we are going to enable each module to optionally specify local behavior - so first file we should read is the .mvsconfig, that maps <lang> to whatever
F) Finally, write out the vendor directory a) check <vendor-dir>/modules.txt and checksums b) write out if necessary
func (*Modder) WriteVendor ¶
type Module ¶
type Module struct { // From mod/sum files Language string LangVer string Module string Version string Require []Require Replace []Replace // Merged version of local require / replace // Requires as replaces will not have the old fields set SelfDeps map[string]Replace // If this module gets replaced ReplaceModule string ReplaceVersion string // Module files in memory ModFile *modfile.File SumFile *sumfile.Sum Mappings *mappingfile.Mappings // TODO, is this modder a good idea for our nested // .mvsconfig processing and vendoring Mdr *Modder Errors []error Ref *plumbing.Reference Refs []*plumbing.Reference Clone *git.GitRepo FS billy.Filesystem }