Versions in this module Expand all Collapse all v0 v0.1.1 Feb 23, 2020 v0.1.0 Oct 29, 2019 Changes in this version + func AllImportPathReplacer(op Op) *cage_strings.ReplaceSet + func DepImportPathReplacer(op Op) *cage_strings.ReplaceSet + func FilepathClean(p string) string + func FromAbs(op Op, parts ...string) string + func MatchAnyDirRelPath(prefix string, config cage_filepath.MatchAnyInput) cage_file.DirMatcher + func MatchAnyFileRelPath(prefix string, config cage_filepath.MatchAnyInput) cage_file.FileMatcher + func ToAbs(op Op, parts ...string) string + type Audit struct + AllDepDirs *cage_strings.Set + AllDepGoFiles *cage_strings.Set + AllDepImportsIntoLocal *cage_pkgs.ImportList + AllImportPathReplacer *cage_strings.ReplaceSet + DepCopyOnlyFiles *cage_strings.Set + DepGlobalIdUsageDag cage_dag.Graph + DepGoDescendantFiles *cage_strings.Set + DepGoTestFiles *cage_strings.Set + DepImportPathReplacer *cage_strings.ReplaceSet + DepInspectDirs *cage_strings.Set + DepReplaceStringFiles *ReplaceStringFiles + DirectDepImportsIntoLocal *cage_pkgs.ImportList + IngressRemovableDirs *cage_strings.Set + IngressRemovableFiles *cage_strings.Set + LocalCopyOnlyFiles *cage_strings.Set + LocalGoDescendantFiles *cage_strings.Set + LocalGoFiles *cage_strings.Set + LocalGoFilesDagRoot cage_pkgs.GlobalId + LocalGoTestFiles *cage_strings.Set + LocalIncludeDirs *cage_strings.Set + LocalInspectDirs *cage_strings.Set + LocalReplaceStringFiles *ReplaceStringFiles + Progress io.Writer + UnconfiguredDirImporters *cage_strings.Set + UnconfiguredDirs map[string]*cage_strings.Set + UsedDepExports map[string]map[string]cage_pkgs.GlobalId + UsedDepGoFiles *cage_strings.Set + UsedDepImportPaths *cage_strings.Set + WhyLog why.Log + func NewEgressAudit(op Op) *Audit + func NewIngressAudit(op Op) *Audit + func (a *Audit) Generate() (errs []error) + func (a *Audit) IsDepGlobalUsedInLocal(g cage_pkgs.GlobalId) bool + func (a *Audit) Op() Op + func (a *Audit) PrintUnconfiguredDirs(w io.Writer) + type Config struct + Ops map[string]Op + Template map[string]string + func (c *Config) ReadFile(name string, _opIds ...string) (errs []error) + type ConfigMatcher struct + BaseFilePath string + CopyOnlyFilesFull cage_file.FileMatcher + CopyOnlyFilesSuffix cage_file.FileMatcher + GoDescendantFilesFull cage_file.FileMatcher + GoDescendantFilesSuffix cage_file.FileMatcher + InspectDirsFull cage_file.DirMatcher + InspectDirsSuffix cage_file.DirMatcher + func NewConfigMatcher(baseFilePath string) *ConfigMatcher + type Copier struct + Audit *Audit + Ctx context.Context + ModuleRequire bool + Op Op + OverwriteMin bool + Plan CopyPlan + ProgressCore io.Writer + ProgressModule io.Writer + Stage *cage_file_stage.Stage + Stderr io.Writer + WhyLog why.Log + func NewCopier(ctx context.Context, audit *Audit) (c *Copier, err error) + func (c *Copier) Run() (_ CopyPlan, errs []error) + type CopyFileError struct + Err string + Name string + type CopyPlan struct + Add []string + Env map[string]string + GoFormatErr []CopyFileError + GoModVendor bool + Overwrite []string + OverwriteSkip []string + PruneGlobalIds []string + PruneGoFiles []string + Remove []string + RenameNotFound []string + StagePath string + func (p *CopyPlan) String() string + func (p *CopyPlan) WriteFile(name string, optFields *cage_strings.Set) (err error) + type Dep struct + From DepFrom + To DepTo + type DepFrom struct + CopyOnlyFilePath FilePathQuery + FilePath string + GoDescendantFilePath FilePathQuery + GoFilePath FilePathQuery + ImportPath string + ReplaceString ReplaceStringSpec + Tests bool + type DepTo struct + FilePath string + ImportPath string + type File struct + AbsPath string + Dir string + FileSet *token.FileSet + Go bool + Mode os.FileMode + Node cage_pkgs.Node + Pkg *cage_pkgs.Package + func NewFile(audit *Audit, newFilePath string) (f *File, err error) + func (f *File) Apply(fn func(cursor *astutil.Cursor) bool) ast.Node + func (f *File) DepDestPaths(op Op, dep Dep) (absPath, relPath string) + func (f *File) GetNodeBytes(node ast.Node) ([]byte, error) + func (f *File) LocalDestPaths(op Op) (absPath, relPath string) + func (f *File) RenameIfGoFileNamedAfterRootPackage(fromImportPath, toImportPath string, allAbsPaths *cage_strings.Set) + func (f *File) RenamePackageClause(topLevelFilePath, fromImportPath, toImportPath string, fileText []byte) []byte + func (f *File) RewriteImportPath(audit *Audit, op Op, importPath string, isLocal bool) string + func (f *File) RewriteImportsInNode(audit *Audit, op Op, cursor *astutil.Cursor, isLocal bool) (err error) + type FileConfig struct + Audit *Audit + ToFilePathPrefix string + type FilePathQuery struct + Exclude []string + Include []string + func (q *FilePathQuery) ResolveTo(basePath string) + func (q FilePathQuery) Copy() (cpy FilePathQuery) + func (q FilePathQuery) Validate() (errs []error) + type FromFinderInput struct + BaseFilePath string + Exclude []*ConfigMatcher + Include *ConfigMatcher + ReplaceString ReplaceStringSpec + type FromFinderOutput struct + AllFiles cage_file.DirToFinderMatchFiles + CopyOnlyFiles *cage_strings.Set + GoDescendantFiles *cage_strings.Set + InspectDirs *cage_strings.Set + InspectIgnoreDirs *cage_strings.Set + ReplaceStringFiles *ReplaceStringFiles + func NewFromFinderOutput() *FromFinderOutput + type Op struct + Dep []Dep + DryRun bool + From RootFrom + Id string + Ingress bool + To RootTo + type PrunableFile struct + DecoratedFile *dst.File + Decorator *decorator.Decorator + func NewPrunableFile(audit *Audit, newFilePath string) (f *PrunableFile, err error) + func (f *PrunableFile) Apply(fn func(cursor *dstutil.Cursor) bool) dst.Node + func (f *PrunableFile) GetImportedPaths(audit *Audit, op Op, isLocal bool) (paths *cage_strings.Set, errs []error) + func (f *PrunableFile) GetNodeBytes(node dst.Node) ([]byte, error) + func (f *PrunableFile) RewriteImportsInNode(audit *Audit, op Op, cursor *dstutil.Cursor, astNode ast.Node, isLocal bool) (err error) + func (f *PrunableFile) UpdateDepAst(audit *Audit, op Op) (prunedGlobalIds *cage_strings.Set, errs []error) + type RenameSpec struct + New string + Old string + type ReplaceStringFiles struct + ImportPath *cage_strings.Set + func NewReplaceStringFiles() *ReplaceStringFiles + type ReplaceStringSpec struct + ImportPath FilePathQuery + type RootFrom struct + CopyOnlyFilePath FilePathQuery + GoDescendantFilePath FilePathQuery + GoFilePath FilePathQuery + LocalFilePath string + LocalImportPath string + ModuleFilePath string + ModuleImportPath string + ModuleSum bool + RenameFilePath []RenameSpec + ReplaceString ReplaceStringSpec + Tests bool + Vendor bool + type RootTo struct + LocalFilePath string + LocalImportPath string + ModuleFilePath string + ModuleImportPath string