model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Left  = Side(0)
	Right = Side(1)
)

Left and Right constants for addressing side in slices.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Type     byte
	Name     string
	Size     string
	Modified string
	Selected bool
}

Item contains information about File/Directory.

func (*Item) IsDirectory

func (item *Item) IsDirectory() bool

IsDirectory retuns true if Item is a directory.

func (Item) String

func (item Item) String() string

type ItemList

type ItemList []Item

ItemList is slice extended as a sortable list of Items (implements sort.Interface).

func (ItemList) Len

func (items ItemList) Len() int

func (ItemList) Less

func (items ItemList) Less(i, j int) bool

func (ItemList) Swap

func (items ItemList) Swap(i, j int)

type Model

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

Model is a structure representing our dpcmder view of files, both left-side DataPower view and right-side local filesystem view.

var M Model = Model{/* contains filtered or unexported fields */}

func (*Model) CurrItem

func (m *Model) CurrItem() *Item

func (*Model) CurrItemForSide

func (m *Model) CurrItemForSide(side Side) *Item

func (*Model) CurrPath

func (m *Model) CurrPath() string

func (*Model) CurrPathForSide

func (m *Model) CurrPathForSide(side Side) string

func (*Model) CurrSide

func (m *Model) CurrSide() Side

func (*Model) CurrentFilter

func (m *Model) CurrentFilter() string

func (*Model) DpDomain

func (m *Model) DpDomain() string

func (*Model) GetSelectedItems

func (m *Model) GetSelectedItems(side Side) []Item

func (*Model) GetVisibleItem

func (m *Model) GetVisibleItem(side Side, rowIdx int) Item

func (*Model) GetVisibleItemCount

func (m *Model) GetVisibleItemCount(side Side) int

func (*Model) IsCurrentItem

func (m *Model) IsCurrentItem(side Side, itemIdx int) bool

func (*Model) IsCurrentRow

func (m *Model) IsCurrentRow(side Side, rowIdx int) bool

func (*Model) IsCurrentSide

func (m *Model) IsCurrentSide(side Side) bool

func (*Model) IsSelectable

func (m *Model) IsSelectable() bool

func (*Model) NavBottom

func (m *Model) NavBottom()

func (*Model) NavDown

func (m *Model) NavDown()

func (*Model) NavPgDown

func (m *Model) NavPgDown()

func (*Model) NavPgUp

func (m *Model) NavPgUp()

func (*Model) NavTop

func (m *Model) NavTop()

func (*Model) NavUp

func (m *Model) NavUp()

func (*Model) NavUpDown

func (m *Model) NavUpDown(side Side, move int)

func (*Model) OtherSide

func (m *Model) OtherSide() Side

func (*Model) SearchNext

func (m *Model) SearchNext(searchStr string) bool

func (*Model) SearchPrev

func (m *Model) SearchPrev(searchStr string) bool

func (*Model) SelPgDown

func (m *Model) SelPgDown()

func (*Model) SelPgUp

func (m *Model) SelPgUp()

func (*Model) SelToBottom

func (m *Model) SelToBottom()

func (*Model) SelToTop

func (m *Model) SelToTop()

func (*Model) SetCurrItemForSide

func (m *Model) SetCurrItemForSide(side Side, itemName string)

func (*Model) SetCurrPath

func (m *Model) SetCurrPath(newPath string)

func (*Model) SetCurrPathForSide

func (m *Model) SetCurrPathForSide(side Side, newPath string)

func (*Model) SetCurrentFilter

func (m *Model) SetCurrentFilter(filterString string)

func (*Model) SetDpDomain

func (m *Model) SetDpDomain(dpDomain string)

func (*Model) SetItems

func (m *Model) SetItems(side Side, items []Item)

func (*Model) SetItemsMaxSize

func (m *Model) SetItemsMaxSize(itemMaxRows, itemMaxCols int)

func (*Model) SetTitle

func (m *Model) SetTitle(side Side, title string)

func (*Model) SortSide

func (m *Model) SortSide(side Side)

func (*Model) Title

func (m *Model) Title(side Side) string

func (*Model) ToggleCurrItem

func (m *Model) ToggleCurrItem()

func (*Model) ToggleSide

func (m *Model) ToggleSide()

type Side

type Side int

Side type is used for Left/Right constants.

Jump to

Keyboard shortcuts

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