Documentation ¶
Overview ¶
This is copy paste of jesseduffield lazydocker filteredlist
This is copy paste of jesseduffield lazydocker side_list_panel - Side doesnt have much meaning in the context of this project
This is copy paste of jesseduffield lazydocker list_panel
Index ¶
- func Clamp(x, min, max int) int
- type FilteredList
- func (self *FilteredList[T]) Filter(filter func(T, int) bool)
- func (self *FilteredList[T]) Get(index int) T
- func (self *FilteredList[T]) GetAllItems() []T
- func (self *FilteredList[T]) GetIndex(item T) int
- func (self *FilteredList[T]) GetItems() []T
- func (self *FilteredList[T]) Len() int
- func (self *FilteredList[T]) SetItems(items []T)
- func (self *FilteredList[T]) Sort(less func(T, T) bool)
- func (self *FilteredList[T]) TryGet(index int) (T, bool)
- type IGui
- type ISideListPanel
- type ListComponent
- func (self *ListComponent[T]) GetView() *gocui.View
- func (self *ListComponent[T]) HandleNextLine() error
- func (self *ListComponent[T]) HandleNextReqTab() error
- func (self *ListComponent[T]) HandleNextResTab() error
- func (self *ListComponent[T]) HandlePrevLine() error
- func (self *ListComponent[T]) HandlePrevReqTab() error
- func (self *ListComponent[T]) HandlePrevResTab() error
- func (self *ListComponent[T]) HandleSelect() error
- func (self *ListComponent[T]) Refocus()
- func (self *ListComponent[T]) RerenderList() error
- func (self *ListComponent[T]) SelectNextLine()
- func (self *ListComponent[T]) SelectPrevLine()
- func (self *ListComponent[T]) SetSelectedLineIdx(value int)
- type ListPanel
- func (self *ListPanel[T]) GetItems() []T
- func (self *ListPanel[T]) GetSelectedItem() (T, error)
- func (self *ListPanel[T]) RemoveSelectedItem() (T, error)
- func (self *ListPanel[T]) SelectNextLine()
- func (self *ListPanel[T]) SelectPrevLine()
- func (self *ListPanel[T]) SetItems(items []T)
- func (self *ListPanel[T]) SetSelectedLineIdx(value int)
- type RequestContext
- func (rc *RequestContext[T]) GetCurrentRequestInfoTab() Tab[T]
- func (rc *RequestContext[T]) GetCurrentResponseInfoTab() Tab[T]
- func (rc *RequestContext[T]) GetRequestInfoTabTitles() []string
- func (rc *RequestContext[T]) GetResponseInfoTabTitles() []string
- func (rp *RequestContext[T]) HandleNextReqTab()
- func (rp *RequestContext[T]) HandleNextResTab()
- func (rp *RequestContext[T]) HandlePrevReqTab()
- func (rp *RequestContext[T]) HandlePrevResTab()
- func (rc *RequestContext[T]) RenderUrl()
- type Tab
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FilteredList ¶
type FilteredList[T comparable] struct { // contains filtered or unexported fields }
FilteredList is a wrapper aound an array for Setting/Filtering/Retrieving Items
func NewFilteredList ¶
func NewFilteredList[T comparable]() *FilteredList[T]
func (*FilteredList[T]) Filter ¶
func (self *FilteredList[T]) Filter(filter func(T, int) bool)
func (*FilteredList[T]) Get ¶
func (self *FilteredList[T]) Get(index int) T
func (*FilteredList[T]) GetAllItems ¶
func (self *FilteredList[T]) GetAllItems() []T
func (*FilteredList[T]) GetIndex ¶
func (self *FilteredList[T]) GetIndex(item T) int
func (*FilteredList[T]) GetItems ¶
func (self *FilteredList[T]) GetItems() []T
func (*FilteredList[T]) Len ¶
func (self *FilteredList[T]) Len() int
returns the length of the filtered list
func (*FilteredList[T]) SetItems ¶
func (self *FilteredList[T]) SetItems(items []T)
func (*FilteredList[T]) Sort ¶
func (self *FilteredList[T]) Sort(less func(T, T) bool)
func (*FilteredList[T]) TryGet ¶
func (self *FilteredList[T]) TryGet(index int) (T, bool)
type ISideListPanel ¶
type ListComponent ¶
type ListComponent[T comparable] struct { Log *logrus.Entry View *gocui.View RequestContext *RequestContext[*commands.Request] ListPanel[T] Gui IGui // returns the cells that we render to the view in a table format. The cells will // be rendered with padding. GetTableCells func(T) []string }
func (*ListComponent[T]) GetView ¶
func (self *ListComponent[T]) GetView() *gocui.View
func (*ListComponent[T]) HandleNextLine ¶
func (self *ListComponent[T]) HandleNextLine() error
func (*ListComponent[T]) HandleNextReqTab ¶
func (self *ListComponent[T]) HandleNextReqTab() error
func (*ListComponent[T]) HandleNextResTab ¶
func (self *ListComponent[T]) HandleNextResTab() error
func (*ListComponent[T]) HandlePrevLine ¶
func (self *ListComponent[T]) HandlePrevLine() error
func (*ListComponent[T]) HandlePrevReqTab ¶
func (self *ListComponent[T]) HandlePrevReqTab() error
func (*ListComponent[T]) HandlePrevResTab ¶
func (self *ListComponent[T]) HandlePrevResTab() error
func (*ListComponent[T]) HandleSelect ¶
func (self *ListComponent[T]) HandleSelect() error
func (*ListComponent[T]) RerenderList ¶
func (self *ListComponent[T]) RerenderList() error
func (*ListComponent[T]) SelectNextLine ¶
func (self *ListComponent[T]) SelectNextLine()
func (*ListComponent[T]) SelectPrevLine ¶
func (self *ListComponent[T]) SelectPrevLine()
func (*ListComponent[T]) SetSelectedLineIdx ¶
func (self *ListComponent[T]) SetSelectedLineIdx(value int)
type ListPanel ¶
type ListPanel[T comparable] struct { SelectedIdx int List *FilteredList[T] View *gocui.View NoItemsMessage string }
List Panel Extends FilteredList to include a View and Current Index. Has methods for moving the SelectedIndex. The View is not directly accessed here. Consider moving up a level
func (*ListPanel[T]) GetSelectedItem ¶
func (*ListPanel[T]) RemoveSelectedItem ¶
func (*ListPanel[T]) SelectNextLine ¶
func (self *ListPanel[T]) SelectNextLine()
func (*ListPanel[T]) SelectPrevLine ¶
func (self *ListPanel[T]) SelectPrevLine()
func (*ListPanel[T]) SetSelectedLineIdx ¶
type RequestContext ¶
type RequestContext[T any] struct { // this function returns the tabs that we can display for an item (the tabs // are shown on the request and response views) GetUrlTab func() Tab[T] GetRequestInfoTabs func() []Tab[T] GetResponseInfoTabs func() []Tab[T] // contains filtered or unexported fields }
the active request determines the entire state of the application. Will be used to render request parameters/ body/ headers and response
func (*RequestContext[T]) GetCurrentRequestInfoTab ¶
func (rc *RequestContext[T]) GetCurrentRequestInfoTab() Tab[T]
func (*RequestContext[T]) GetCurrentResponseInfoTab ¶
func (rc *RequestContext[T]) GetCurrentResponseInfoTab() Tab[T]
func (*RequestContext[T]) GetRequestInfoTabTitles ¶
func (rc *RequestContext[T]) GetRequestInfoTabTitles() []string
// Request Tab
func (*RequestContext[T]) GetResponseInfoTabTitles ¶
func (rc *RequestContext[T]) GetResponseInfoTabTitles() []string
// Response Tab
func (*RequestContext[T]) HandleNextReqTab ¶
func (rp *RequestContext[T]) HandleNextReqTab()
func (*RequestContext[T]) HandleNextResTab ¶
func (rp *RequestContext[T]) HandleNextResTab()
func (*RequestContext[T]) HandlePrevReqTab ¶
func (rp *RequestContext[T]) HandlePrevReqTab()
func (*RequestContext[T]) HandlePrevResTab ¶
func (rp *RequestContext[T]) HandlePrevResTab()
func (*RequestContext[T]) RenderUrl ¶
func (rc *RequestContext[T]) RenderUrl()