packages

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details struct {
	// Files is a map of file name to action (insert, delete, modified in a git sense)
	// The action is a string that can be converted to merkletrie.Action
	// The key is the file path
	Files              utils.StringSet            `json:"files"`
	ImportedImportPath map[ImportPath]*ImportedBy `json:"imported_by"`
}

type ImportPath

type ImportPath string

ImportPath is a type that represents a package name. A package name is the module name suffixed by the path of the package.

func GetImportPathFromPath

func GetImportPathFromPath(moduleName, modulePath, path string, isDir bool) (ImportPath, error)

GetImportPathFromPath try to get the import path from a path. moduleName is the name of the module in which the path is. modulePath is the path of the module in which the path is. Example: the current path here is pkg/diff/packages/types.go it will give github.com/alexisvisco/gwd/pkg/diff/packages/types

type ImportedBy

type ImportedBy struct {
	ModuleName string `json:"module_name"`
	ModulePath string `json:"module_path"`
	Counter    int    `json:"counter"`
}

type Modified

type Modified map[ImportPath]*Details

Modified represent a list of changes for a package The key is the package import path The value is a struct containing the list of files affected and the list of packages that import this package

func NewChanges

func NewChanges() Modified

func (Modified) AddImportPathWhichImportModifiedPackage

func (p Modified) AddImportPathWhichImportModifiedPackage(moduleName, modulePath string, importPathChanged, importedByImportPath ImportPath)

AddImportPathWhichImportModifiedPackage will add the import path that import a package which have been modified moduleName, modulePath are the module name and path of the import path that import a modified package importedByImportPath is the package import path which import a package modified importPathChanged is the package import path that have been modified

func (Modified) AddModifiedPackage

func (p Modified) AddModifiedPackage(importPath ImportPath, file string)

AddModifiedPackage will add a file that have been modified

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL