filetree

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const COLLAPSED_ARROW = "►"
View Source
const EXPANDED_ARROW = "▼"
View Source
const INNER_ITEM = "├─ "
View Source
const LAST_ITEM = "└─ "
View Source
const NESTED = "│  "
View Source
const NOTHING = "   "

Variables

This section is empty.

Functions

This section is empty.

Types

type CollapsedPaths

type CollapsedPaths map[string]bool

func (CollapsedPaths) ExpandToPath

func (cp CollapsedPaths) ExpandToPath(path string)

func (CollapsedPaths) IsCollapsed

func (cp CollapsedPaths) IsCollapsed(path string) bool

func (CollapsedPaths) ToggleCollapsed

func (cp CollapsedPaths) ToggleCollapsed(path string)

type CommitFileManager

type CommitFileManager struct {
	// contains filtered or unexported fields
}

func NewCommitFileManager

func NewCommitFileManager(files []*models.CommitFile, log *logrus.Entry, showTree bool) *CommitFileManager

func (*CommitFileManager) ExpandToPath

func (m *CommitFileManager) ExpandToPath(path string)

func (*CommitFileManager) GetAllFiles

func (m *CommitFileManager) GetAllFiles() []*models.CommitFile

func (*CommitFileManager) GetAllItems

func (m *CommitFileManager) GetAllItems() []*CommitFileNode

func (*CommitFileManager) GetIndexForPath

func (m *CommitFileManager) GetIndexForPath(path string) (int, bool)

func (*CommitFileManager) GetItemAtIndex

func (m *CommitFileManager) GetItemAtIndex(index int) *CommitFileNode

func (*CommitFileManager) GetItemsLength

func (m *CommitFileManager) GetItemsLength() int

func (*CommitFileManager) GetParent

func (m *CommitFileManager) GetParent() string

func (*CommitFileManager) IsCollapsed

func (m *CommitFileManager) IsCollapsed(path string) bool

func (*CommitFileManager) Render

func (m *CommitFileManager) Render(diffName string, patchManager *patch.PatchManager) []string

func (*CommitFileManager) SetFiles

func (m *CommitFileManager) SetFiles(files []*models.CommitFile, parent string)

func (*CommitFileManager) SetTree

func (m *CommitFileManager) SetTree()

func (*CommitFileManager) ToggleCollapsed

func (m *CommitFileManager) ToggleCollapsed(path string)

func (*CommitFileManager) ToggleShowTree

func (m *CommitFileManager) ToggleShowTree()

type CommitFileNode

type CommitFileNode struct {
	Children         []*CommitFileNode
	File             *models.CommitFile
	Path             string // e.g. '/path/to/mydir'
	CompressionLevel int    // equal to the number of forward slashes you'll see in the path when it's rendered in tree mode
}

func BuildFlatTreeFromCommitFiles

func BuildFlatTreeFromCommitFiles(files []*models.CommitFile) *CommitFileNode

func BuildTreeFromCommitFiles

func BuildTreeFromCommitFiles(files []*models.CommitFile) *CommitFileNode

func (*CommitFileNode) Any

func (s *CommitFileNode) Any(test func(node *CommitFileNode) bool) bool

func (*CommitFileNode) AnyFile

func (s *CommitFileNode) AnyFile(test func(file *models.CommitFile) bool) bool

func (*CommitFileNode) Compress

func (s *CommitFileNode) Compress()

func (*CommitFileNode) Description

func (s *CommitFileNode) Description() string

func (*CommitFileNode) Every

func (s *CommitFileNode) Every(test func(node *CommitFileNode) bool) bool

func (*CommitFileNode) EveryFile

func (s *CommitFileNode) EveryFile(test func(file *models.CommitFile) bool) bool

func (*CommitFileNode) Flatten

func (n *CommitFileNode) Flatten(collapsedPaths map[string]bool) []*CommitFileNode

func (*CommitFileNode) ForEachFile

func (s *CommitFileNode) ForEachFile(cb func(*models.CommitFile) error) error

func (*CommitFileNode) GetChildren

func (s *CommitFileNode) GetChildren() []INode

func (*CommitFileNode) GetCompressionLevel

func (s *CommitFileNode) GetCompressionLevel() int

func (*CommitFileNode) GetIndexForPath

func (node *CommitFileNode) GetIndexForPath(path string, collapsedPaths map[string]bool) (int, bool)

func (*CommitFileNode) GetLeaves

func (s *CommitFileNode) GetLeaves() []*CommitFileNode

func (*CommitFileNode) GetNodeAtIndex

func (node *CommitFileNode) GetNodeAtIndex(index int, collapsedPaths map[string]bool) *CommitFileNode

func (*CommitFileNode) GetPath

func (s *CommitFileNode) GetPath() string

func (*CommitFileNode) GetPathsMatching

func (node *CommitFileNode) GetPathsMatching(test func(*CommitFileNode) bool) []string

This ignores the root

func (*CommitFileNode) ID

func (s *CommitFileNode) ID() string

func (*CommitFileNode) IsLeaf

func (s *CommitFileNode) IsLeaf() bool

func (*CommitFileNode) NameAtDepth

func (s *CommitFileNode) NameAtDepth(depth int) string

func (*CommitFileNode) SetChildren

func (s *CommitFileNode) SetChildren(children []INode)

func (*CommitFileNode) SetCompressionLevel

func (s *CommitFileNode) SetCompressionLevel(level int)

func (*CommitFileNode) Size

func (node *CommitFileNode) Size(collapsedPaths map[string]bool) int

func (*CommitFileNode) Sort

func (s *CommitFileNode) Sort()

type FileManager

type FileManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewFileManager

func NewFileManager(files []*models.File, log *logrus.Entry, showTree bool) *FileManager

func (*FileManager) ExpandToPath

func (m *FileManager) ExpandToPath(path string)

func (*FileManager) GetAllFiles

func (m *FileManager) GetAllFiles() []*models.File

func (*FileManager) GetAllItems

func (m *FileManager) GetAllItems() []*FileNode

func (*FileManager) GetIndexForPath

func (m *FileManager) GetIndexForPath(path string) (int, bool)

func (*FileManager) GetItemAtIndex

func (m *FileManager) GetItemAtIndex(index int) *FileNode

func (*FileManager) GetItemsLength

func (m *FileManager) GetItemsLength() int

func (*FileManager) InTreeMode

func (m *FileManager) InTreeMode() bool

func (*FileManager) IsCollapsed

func (m *FileManager) IsCollapsed(path string) bool

func (*FileManager) Render

func (m *FileManager) Render(diffName string, submoduleConfigs []*models.SubmoduleConfig) []string

func (*FileManager) SetFiles

func (m *FileManager) SetFiles(files []*models.File)

func (*FileManager) SetTree

func (m *FileManager) SetTree()

func (*FileManager) ToggleCollapsed

func (m *FileManager) ToggleCollapsed(path string)

func (*FileManager) ToggleShowTree

func (m *FileManager) ToggleShowTree()

type FileNode

type FileNode struct {
	Children         []*FileNode
	File             *models.File
	Path             string // e.g. '/path/to/mydir'
	CompressionLevel int    // equal to the number of forward slashes you'll see in the path when it's rendered in tree mode
}

func BuildFlatTreeFromFiles

func BuildFlatTreeFromFiles(files []*models.File) *FileNode

func BuildTreeFromFiles

func BuildTreeFromFiles(files []*models.File) *FileNode

func (*FileNode) Any

func (s *FileNode) Any(test func(node *FileNode) bool) bool

func (*FileNode) AnyFile

func (s *FileNode) AnyFile(test func(file *models.File) bool) bool

func (*FileNode) Compress

func (s *FileNode) Compress()

func (*FileNode) Description

func (s *FileNode) Description() string

func (*FileNode) Flatten

func (n *FileNode) Flatten(collapsedPaths map[string]bool) []*FileNode

func (*FileNode) ForEachFile

func (s *FileNode) ForEachFile(cb func(*models.File) error) error

func (*FileNode) GetChildren

func (s *FileNode) GetChildren() []INode

func (*FileNode) GetCompressionLevel

func (s *FileNode) GetCompressionLevel() int

func (*FileNode) GetHasInlineMergeConflicts

func (s *FileNode) GetHasInlineMergeConflicts() bool

func (*FileNode) GetHasStagedChanges

func (s *FileNode) GetHasStagedChanges() bool

func (*FileNode) GetHasUnstagedChanges

func (s *FileNode) GetHasUnstagedChanges() bool

func (*FileNode) GetIndexForPath

func (node *FileNode) GetIndexForPath(path string, collapsedPaths map[string]bool) (int, bool)

func (*FileNode) GetIsTracked

func (s *FileNode) GetIsTracked() bool

func (*FileNode) GetLeaves

func (s *FileNode) GetLeaves() []*FileNode

func (*FileNode) GetNodeAtIndex

func (node *FileNode) GetNodeAtIndex(index int, collapsedPaths map[string]bool) *FileNode

func (*FileNode) GetPath

func (s *FileNode) GetPath() string

func (*FileNode) GetPathsMatching

func (node *FileNode) GetPathsMatching(test func(*FileNode) bool) []string

This ignores the root

func (*FileNode) ID

func (s *FileNode) ID() string

func (*FileNode) IsLeaf

func (s *FileNode) IsLeaf() bool

func (*FileNode) NameAtDepth

func (s *FileNode) NameAtDepth(depth int) string

func (*FileNode) SetChildren

func (s *FileNode) SetChildren(children []INode)

func (*FileNode) SetCompressionLevel

func (s *FileNode) SetCompressionLevel(level int)

func (*FileNode) Size

func (node *FileNode) Size(collapsedPaths map[string]bool) int

func (*FileNode) Sort

func (s *FileNode) Sort()

type INode

type INode interface {
	IsLeaf() bool
	GetPath() string
	GetChildren() []INode
	SetChildren([]INode)
	GetCompressionLevel() int
	SetCompressionLevel(int)
}

Jump to

Keyboard shortcuts

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