Documentation ¶
Overview ¶
Package gsc implements data structure and utils used by gsc cmd
Index ¶
- Constants
- Variables
- func BuildPackageMap(filesystem fs.FS, dbPath string) (entries map[string]*PkgItem)
- func CheckErr(err error)
- func GetItemType(info fs.FileInfo) (string, error)
- func IsExcluded(ignorePatterns []string, path string) bool
- func LoadIgnorePatterns(filesystem fs.FS, filename string) []string
- func WalkSymlink(filesystem ExFS, path string) (string, string, error)
- type ExDirFs
- type ExFS
- type FsItem
- type PkgItem
Constants ¶
const LinkStateDead = "dead"
LinkStateDead is the invalid state of a symlink
const LinkStateValid = "valid"
LinkStateValid is the valid state of a symlink
const TypeDirectory = "dir"
TypeDirectory represents a directory in portage
const TypeFile = "obj"
TypeFile represents a file in portage
const TypeSymlink = "sym"
TypeSymlink represents a symlink in portage
Variables ¶
var ErrDeadLink = errors.New(LinkStateDead)
ErrDeadLink is the error in case of dead link
Functions ¶
func BuildPackageMap ¶
BuildPackageMap builds an map with path as key and PkgItem as value of portage database content
func GetItemType ¶
GetItemType returns the portage type from a real file (info)
func IsExcluded ¶
IsExcluded checks if a path is excluded from check
func LoadIgnorePatterns ¶
LoadIgnorePatterns loads patterns from a .gscignore file.
Types ¶
type ExDirFs ¶
type ExDirFs string
ExDirFs is the base ExFS implementation
type ExFS ¶
type ExFS interface { fs.FS Readlink(name string) (string, error) Lstat(name string) (os.FileInfo, error) }
ExFS is an fs.FS extension with symlink operations
type FsItem ¶
type FsItem struct { Typ string // object type Path string // real path Target string // target, only if typ is symlink Endtarget string // last no (valid) symlink recursive target Md5 []byte // checksum of the file if typ is obj (file) Info fs.FileInfo // file info LinkState string // state of the link if symlink }
FsItem represents a file on the filesystem