Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirsFilter ¶
type DirsFilter struct {
// contains filtered or unexported fields
}
DirsFilter filters *Entry by its type and allows directories only.
func (*DirsFilter) ID ¶
func (df *DirsFilter) ID() ID
func (*DirsFilter) Reset ¶
func (df *DirsFilter) Reset()
func (*DirsFilter) Toggle ¶
func (df *DirsFilter) Toggle()
type EntryFilter ¶
type EntryFilter interface {
// ID returns a filter identifier allowing to uniquely identify the filter.
ID() ID
// Filter contains the filtering logic and returns a bool value on whether
// the *Entry instance passed the filtration.
Filter(e *structure.Entry) bool
// Toggle enables or disables the filter.
Toggle()
// Reset resets the filter's state and disables it.
Reset()
}
EntryFilter defines a contract for filtering a single *structure.Entry instance.
type FilesFilter ¶
type FilesFilter struct {
// contains filtered or unexported fields
}
FilesFilter filters *Entry by its type and allows files only.
func (*FilesFilter) ID ¶
func (df *FilesFilter) ID() ID
func (*FilesFilter) Reset ¶
func (df *FilesFilter) Reset()
func (*FilesFilter) Toggle ¶
func (df *FilesFilter) Toggle()
type FiltersList ¶
type FiltersList map[ID]EntryFilter
FiltersList aggregates a list of multiple filters.
func NewFiltersList ¶
func NewFiltersList(ef ...EntryFilter) FiltersList
NewFiltersList creates a new list of filters based on the provided argument. All filters should be disabled/inactive by default.
func (*FiltersList) Reset ¶
func (fl *FiltersList) Reset()
Reset traverses all filters in the list and calls EntryFilter.Reset method for each of them.
func (*FiltersList) ToggleFilter ¶
func (fl *FiltersList) ToggleFilter(id ID)
ToggleFilter enables or disables the provided filter by the provided unique filter name. Unknown filters that were not added to the list will be ignored.
func (*FiltersList) Update ¶
func (fl *FiltersList) Update(msg tea.Msg)
Update traverses all filters implementing the Updater interface in order to update the filters' state based on incoming input.
type NameFilter ¶
type NameFilter struct {
// contains filtered or unexported fields
}
NameFilter filters a single instance of the *structure.Entry by its path value. If the entry's path value does not contain the user's input, it will not be filtered/discarded.
The user's input is handled by the textinput.Model instance, therefore the filter must update internal state by providing the corresponding Updater implementation.
func NewNameFilter ¶
func NewNameFilter(placeholder string) *NameFilter
func (*NameFilter) Filter ¶
func (nf *NameFilter) Filter(e *structure.Entry) bool
Filter filters an instance of *structure.Entry by checking if its path value contains the current filter input.
func (*NameFilter) ID ¶
func (nf *NameFilter) ID() ID
func (*NameFilter) Reset ¶
func (nf *NameFilter) Reset()
func (*NameFilter) Toggle ¶
func (nf *NameFilter) Toggle()
func (*NameFilter) Update ¶
func (nf *NameFilter) Update(msg tea.Msg)
func (*NameFilter) View ¶
func (nf *NameFilter) View() string