folders

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedCommands = func() []string {
	keys := make([]string, 0, len(AllowedCommandsFunctions))
	for k := range AllowedCommandsFunctions {
		keys = append(keys, k)
	}
	return keys
}()
View Source
var AllowedCommandsFunctions = map[string]func(string) string{
	"vscode":           func(p string) string { return fmt.Sprintf("code \"%s\"", p) },
	consts.FlagDisable: func(p string) string { return "" },
	"explorer":         func(p string) string { return fmt.Sprintf("xdg-open \"%s\"", p) },
}

Functions

This section is empty.

Types

type Folder

type Folder struct {
	Path             string `yaml:"-"`
	Ignore           bool   `yaml:"ignore"`
	IgnoreSubFolders bool   `yaml:"ignore_sub"`
	Command          string `yaml:"cmd"`
}

func (*Folder) Match

func (f *Folder) Match(words []string) bool

func (*Folder) SetCommand

func (f *Folder) SetCommand(cmd string)

func (*Folder) String added in v1.4.0

func (f *Folder) String() string

type FolderCollection

type FolderCollection struct {
	Root     string             `yaml:"root"`
	Folders  map[string]*Folder `yaml:"folders"`
	MaxDepth int                `yaml:"maxSubLevel"`
}

func CreateCollection

func CreateCollection(root string, maxSubLevel int) *FolderCollection

func (*FolderCollection) Find

func (fc *FolderCollection) Find(words []string) (folders []*Folder)

func (*FolderCollection) FixIgnored

func (fc *FolderCollection) FixIgnored()

func (*FolderCollection) FixPathsLoad

func (fc *FolderCollection) FixPathsLoad()

func (*FolderCollection) Get

func (fc *FolderCollection) Get(path string) (*Folder, error)

func (*FolderCollection) GetChildren

func (fc *FolderCollection) GetChildren(folder *Folder) []*Folder

func (*FolderCollection) GetNearestParent

func (fc *FolderCollection) GetNearestParent(folder string, keepFinding bool) (*Folder, error)

func (*FolderCollection) GetParent

func (fc *FolderCollection) GetParent(folder *Folder) (*Folder, error)

func (*FolderCollection) String added in v1.4.0

func (fc *FolderCollection) String() string

func (*FolderCollection) Sync

func (fc *FolderCollection) Sync() error

Jump to

Keyboard shortcuts

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