Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDirFilesCursor ¶
Types ¶
type DirLoader ¶
type DirLoader struct {
// contains filtered or unexported fields
}
func (*DirLoader) LoadDirFromDataset ¶
func (d *DirLoader) LoadDirFromDataset(dataset model.DatasetSchema, projectID string) error
type Selection ¶
type Selection struct { // IncludeFiles are files that have been explicitly included IncludeFiles map[string]bool // ExcludeFiles are files that have been explicitly excluded ExcludeFiles map[string]bool // IncludeFiles are directories that have been explicitly included IncludeDirs map[string]bool // ExcludeFiles are directories that have been explicitly excluded ExcludeDirs map[string]bool // Parents is used to track directories that are not in the included and excluded lists. // This is used, for example, to track descendant directories under a directory that has // been explicitly included or excluded. The application using selection calls AddDir to // add directories into this list. Parents map[string]bool }
Selection keeps track of directories and files and whether or not they have been included
func FromFileSelection ¶
func FromFileSelection(s *model.FileSelection) *Selection
FromFileSelection creates a new Selection by taking a FileSelection and inserting its entries into the Selection fields.
func NewSelection ¶
func NewSelection() *Selection
NewSelection creates a new Selection. All map entries have been initialized.
func (*Selection) AddDir ¶
AddDir will add a directory to the Parents field. Callers should add directories to this list when that entry is not already in the selection. Directories are not added if they are in either IncludeDirs or ExcludeDirs. It checks ExcludeDirs when included is false, otherwise it checks IncludeDirs.
func (*Selection) DirExists ¶
DirExists checks if the given dir path exists in the Selection. It returns 2 booleans. The first is true if dir is in IncludeDirs, and false if it is is ExcludeDirs. The second boolean denotes whether or not the dirPath was found. For example:
DirExists("path") => true, true --> in include dirs (first boolean) and found DirExists("path") => false, true --> in exclude dirs (first boolean) and found DirExists("path") => false, false --> first value is not meaningful, entry not found
func (*Selection) IsIncludedDir ¶
IsIncludedDir checks if a directory is a part of a selection. It first checks the IncludeDirs field, then checks the ExcludeDirs field. If no entry is found in either of these then it checks the Parents field and returns its value if it exists. If after all these checks there is no match then it returns false signifying that the directory is not one that has been selected.
func (*Selection) IsIncludedFile ¶
IsIncludedFile checks if a file is a part of a selection. It first checks IncludeFiles, then checks ExcludeFiles. If no entry has been found then it returns the files directory by calling IsIncludedDir on the file directory.