Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileCache ¶
type FileCache interface { // Absolute path to the root of the Go module abstracted by this filecache. Root() string // Module path for the Go module abstracted by this filecache. ModulePath() string // Set of all the Go packages contained within the module abstracted by this filecache. Pkgs() map[string]bool // Set of all Go and non-Go files contained within the module abstracted by this filecache. The // retured paths are all relative to the module's root. Files() map[string]bool // Set of all Go and non-Go files contained within the specified Go package. The package must be // part of the module abstracted by this filecache. The returned paths are all relative to the // module's root. FilesInPkg(pkg string) (map[string]bool, error) // Retrieve the content of an arbitrary file if it exists within the module abstracted by this // filecache. The path argument is interpreted as relative to the root of the module. ReadFile(path string) ([]byte, error) // Retrieve the parsed data of a Go file if it exists within the module abstracted by this // filecache. The path argument is interpreted as relative to the root of the module. The // returned ast.File object may be modified and tweaked without it affecting the result of any // subsequent calls to ReadGoFile for the same path. ReadGoFile(path string, loadFlags parser.Mode) (*ast.File, *token.FileSet, error) }
FileCache represents an abstraction for read-only access to the files and information of a Go module.
Click to show internal directories.
Click to hide internal directories.