Documentation ¶
Overview ¶
Package multiSelect provides functions that help define and draw a multi-select step
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func FetchAllFolders ¶
func FetchRepoFiles ¶
func FetchRepoFiles(url string, fetch *Fetch) ([]api.TreeElement, error)
Types ¶
type ContentTree ¶
type ContentTree struct { Tree map[string]*Node CurPath string RootPath string SelectedRepo map[string][]api.TreeElement FolderRepo []api.TreeElement Mu sync.Mutex }
TODO: Rename the FolderRepo to SelectedFolders and SelectedRepo to SelectedFiles
func (*ContentTree) AppendSelected ¶
func (c *ContentTree) AppendSelected()
AppendSelected compiles all selected repositories from the ContentTree's Tree map into the SelectedRepo slice. It filters and returns a slice of repositories with type "dir".
Returns: - []api.Repo: Slice of "dir" type selected repositories.
func (*ContentTree) RemoveAllCurTreeRepo ¶
func (c *ContentTree) RemoveAllCurTreeRepo()
RemoveAllCurTreeRepo deselects (removes) all selected repositories at the current path within the tree.
func (*ContentTree) SelectAllCurTreeRepo ¶
func (c *ContentTree) SelectAllCurTreeRepo()
SelectAllCurTreeRepo selects all repositories at the current path within the tree.
func (*ContentTree) SelectedRepoLen ¶
func (c *ContentTree) SelectedRepoLen() int
func (*ContentTree) UpdateTreesSelected ¶
func (c *ContentTree) UpdateTreesSelected(index int)
UpdateTreesSelected updates the selection status of a repository at the current path (CurPath) identified by index.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func InitialModelMultiSelect ¶
func InitialModelMultiSelect(clintFetch *Fetch, conTree *ContentTree, header string, quit *bool) Model
type Node ¶
type Node struct { SelectedRepo map[int]struct{} Repo []api.TreeElement }
func (*Node) RemoveAllRepo ¶
func (n *Node) RemoveAllRepo()
RemoveAllRepo deselects (removes) all selected repositories within this node.
func (*Node) SelecteAllRepo ¶
func (n *Node) SelecteAllRepo()
SelecteAllRepo selects all repositories within this node. It does so by adding all indices to SelectedRepo if the number of repositories is greater than the number of selected repositories.
func (*Node) UpdateSelectedRepo ¶
UpdateSelectedRepo toggles the selection status of a repository identified by key. If the repository is already selected, it is deselected (removed from SelectedRepo); if it is not selected, it is added