-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmodels.go
50 lines (41 loc) · 1.18 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"context"
"sync"
"github.com/gdamore/tcell"
"github.com/rivo/tview"
)
//go:generate mockgen -source=$GOFILE -destination=./mock/mock.go
type IPages interface {
tview.Primitive
AddPage(name string, item tview.Primitive, resize, visible bool) *tview.Pages
RemovePage(name string) *tview.Pages
}
type ITable interface {
tview.Primitive
SetSelectable(rows, columns bool) *tview.Table
SetCell(row, column int, cell *tview.TableCell) *tview.Table
ScrollToEnd() *tview.Table
GetCell(row, column int) *tview.TableCell
Clear() *tview.Table
ScrollToBeginning() *tview.Table
GetSelection() (row, column int)
SetSelectedFunc(handler func(row, column int)) *tview.Table
SetMouseCapture(capture func(action tview.MouseAction, event *tcell.EventMouse) (tview.MouseAction, *tcell.EventMouse)) *tview.Box
Select(row, column int) *tview.Table
GetColumnCount() int
GetRowCount() int
GetBackgroundColor() tcell.Color
}
type tableView struct {
sync.RWMutex
app *tview.Application
table ITable
pages IPages
line map[string]*tline
in chan string
ctx context.Context
sortColumn int
csvFileName string
lang string
}