Documentation ¶
Index ¶
- Constants
- type Coordinator
- type ErrorMsg
- type FCDState
- type FuncLogDetailState
- type FuncLogDetailStateMutable
- type FuncLogDetailVM
- type FuncLogDetailView
- type GState
- type GraphCache
- type GraphState
- type GraphStateMutable
- type GraphVM
- type GraphView
- type GraphWidget
- func (v *GraphWidget) AddLine(line Line)
- func (v *GraphWidget) Draw(p *tui.Painter)
- func (v *GraphWidget) PartialDraw(p *tui.Painter, area1, area2 image.Point)
- func (v *GraphWidget) RemoveLines()
- func (v *GraphWidget) ScrollArea() image.Point
- func (v *GraphWidget) SetLines(lines []Line)
- func (v *GraphWidget) SetOrigin(origin Origin)
- func (v *GraphWidget) SizeHint() image.Point
- type LLState
- type LRState
- type Line
- type LineTermination
- type LineType
- type LogListState
- type LogListStateMutable
- type LogListVM
- type LogListView
- type LogRecordState
- type LogRecordStateMutable
- type LogRecordVM
- type LogRecordView
- type Origin
- type ScrollMode
- type ScrollWidget
- type ScrollableWidget
- type UICoordinator
- type UIState
- type Updatable
- type Updater
- type View
- type ViewModel
Constants ¶
View Source
const ( LoadingText = "Loading ..." NoLogFiles = "Available logs not found" ErrorText = "Error" StatusRunningText = "Running" StatusStoppedText = "" RunningStyleName = "status-running" StoppedStyleName = "status-stopped" APIConnections = 4 UpdateInterval = 500 * time.Millisecond )
View Source
const (
DefaultUpdateInterval = 200 * time.Millisecond
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator interface { // SetState sets status of the Coordinator to s. SetState(s UIState) // NotifyVMUpdated notifies that current ViewModel is updated. // Coordinator MUST replace views. NotifyVMUpdated() }
Coordinator manages the navigation flow.
type FuncLogDetailState ¶
type FuncLogDetailStateMutable ¶
type FuncLogDetailStateMutable FuncLogDetailState
type FuncLogDetailVM ¶
type FuncLogDetailVM struct { Root Coordinator Client restapi.ClientWithCtx LogID string Record types.FuncLog // contains filtered or unexported fields }
func (*FuncLogDetailVM) Update ¶
func (vm *FuncLogDetailVM) Update(ctx context.Context)
func (*FuncLogDetailVM) UpdateInterval ¶
func (vm *FuncLogDetailVM) UpdateInterval() time.Duration
func (*FuncLogDetailVM) View ¶
func (vm *FuncLogDetailVM) View() View
type FuncLogDetailView ¶
type FuncLogDetailView struct { VM *FuncLogDetailVM FuncLogDetailState // contains filtered or unexported fields }
func (*FuncLogDetailView) FocusChain ¶
func (v *FuncLogDetailView) FocusChain() tui.FocusChain
func (*FuncLogDetailView) Keybindings ¶
func (v *FuncLogDetailView) Keybindings() map[string]func()
func (*FuncLogDetailView) Widget ¶
func (v *FuncLogDetailView) Widget() tui.Widget
type GraphCache ¶
type GraphCache struct { LogInfo types.LogInfo Symbols *types.Symbols Records []types.FuncLog GMap map[types.GID]types.Goroutine // contains filtered or unexported fields }
func (*GraphCache) EndedFuncLogs ¶
func (c *GraphCache) EndedFuncLogs(t types.Time) int
EndedFuncLogsは、時刻tの時点で実行が終了したFuncLogの数を返す。
func (*GraphCache) RunningFuncLogs ¶
func (c *GraphCache) RunningFuncLogs(t types.Time) int
RunningFuncLogsは、時刻tの時点で実行中のFuncLogの数を返す。
func (*GraphCache) Update ¶
func (c *GraphCache) Update(logID string, client restapi.ClientWithCtx) error
type GraphState ¶
type GraphStateMutable ¶
type GraphStateMutable struct {
GraphState
}
func (*GraphStateMutable) UpdateOffset ¶
func (s *GraphStateMutable) UpdateOffset(dx, dy int)
type GraphVM ¶
type GraphVM struct { Root Coordinator Client restapi.ClientWithCtx LogID string // contains filtered or unexported fields }
func (*GraphVM) UpdateInterval ¶
type GraphView ¶
type GraphView struct { VM *GraphVM GraphState // contains filtered or unexported fields }
func (*GraphView) FocusChain ¶
func (v *GraphView) FocusChain() tui.FocusChain
func (*GraphView) Keybindings ¶
type GraphWidget ¶
type GraphWidget struct { tui.WidgetBase // contains filtered or unexported fields }
GraphWidget helps to painting the DAG (Directed Acyclic Graph).
func (*GraphWidget) AddLine ¶
func (v *GraphWidget) AddLine(line Line)
func (*GraphWidget) Draw ¶
func (v *GraphWidget) Draw(p *tui.Painter)
func (*GraphWidget) PartialDraw ¶
func (v *GraphWidget) PartialDraw(p *tui.Painter, area1, area2 image.Point)
func (*GraphWidget) RemoveLines ¶
func (v *GraphWidget) RemoveLines()
func (*GraphWidget) ScrollArea ¶
func (v *GraphWidget) ScrollArea() image.Point
func (*GraphWidget) SetLines ¶
func (v *GraphWidget) SetLines(lines []Line)
func (*GraphWidget) SetOrigin ¶
func (v *GraphWidget) SetOrigin(origin Origin)
func (*GraphWidget) SizeHint ¶
func (v *GraphWidget) SizeHint() image.Point
type Line ¶
type Line struct { Start image.Point Length int Type LineType StartDeco LineTermination EndDeco LineTermination StyleName string }
type LineTermination ¶
type LineTermination int
LineTerminationは、線の終端の描画方法を指定する。 デフォルトは LineTerminationNormal である。
const ( // 線の終端に"●"を描画する。 // 線の長さが1なら、線の代わりに点だけが描画される。 LineTerminationNormal LineTermination = iota // 線の終端に"◎"を描画する。 // 線の長さが1なら、線の代わりに点だけが描画される。 LineTerminationHighlight // 終端まで通常の縦棒 or 横棒が描画される。 // 終端に点を描画しない。 LineTerminationNone )
func (LineTermination) Rune ¶
func (p LineTermination) Rune(defaultRune rune) rune
type LogListState ¶
type LogListStateMutable ¶
type LogListStateMutable LogListState
type LogListVM ¶
type LogListVM struct { Root Coordinator Client restapi.ClientWithCtx // contains filtered or unexported fields }
LogListVM implements ViewModel.
func (*LogListVM) SelectedLog ¶
func (*LogListVM) UpdateInterval ¶
type LogListView ¶
type LogListView struct { VM *LogListVM LogListState // contains filtered or unexported fields }
LogListView implements View
func (*LogListView) FocusChain ¶
func (v *LogListView) FocusChain() tui.FocusChain
func (*LogListView) Keybindings ¶
func (v *LogListView) Keybindings() map[string]func()
func (*LogListView) Widget ¶
func (v *LogListView) Widget() tui.Widget
type LogRecordState ¶
type LogRecordStateMutable ¶
type LogRecordStateMutable LogRecordState
type LogRecordVM ¶
type LogRecordVM struct { Root Coordinator Client restapi.ClientWithCtx LogID string // contains filtered or unexported fields }
func (*LogRecordVM) Update ¶
func (vm *LogRecordVM) Update(ctx context.Context)
func (*LogRecordVM) UpdateInterval ¶
func (vm *LogRecordVM) UpdateInterval() time.Duration
func (*LogRecordVM) View ¶
func (vm *LogRecordVM) View() View
type LogRecordView ¶
type LogRecordView struct { VM *LogRecordVM LogRecordState // contains filtered or unexported fields }
func (*LogRecordView) FocusChain ¶
func (v *LogRecordView) FocusChain() tui.FocusChain
func (*LogRecordView) Keybindings ¶
func (v *LogRecordView) Keybindings() map[string]func()
func (*LogRecordView) Widget ¶
func (v *LogRecordView) Widget() tui.Widget
type Origin ¶
type Origin int
原点座標を tui.Surface 上のどこに配置するか指定する。 デフォルトは OriginTopLeft である。
const ( // 原点は左上に配置する。 // 0────→ X // │.... // │.... // ↓ // Y OriginTopLeft Origin = iota // 原点を右上に配置する。 // X軸の方向が反対にになることに注意。 // X ←────0 // ....│ // ....│ // ↓ // Y OriginTopRight // 原点を左下に配置する。通常の数学のグラフと同じ配置である。 // Y // ⇡ // │.... // │.... // 0────→ X OriginBottomLeft // 原点を右下に配置する。 // Y // ⇡ // ....│ // ....│ // X ←────0 OriginBottomRight )
type ScrollWidget ¶
type ScrollWidget struct { ScrollableWidget // contains filtered or unexported fields }
func (*ScrollWidget) AutoScroll ¶
func (w *ScrollWidget) AutoScroll(x, y bool)
func (*ScrollWidget) Draw ¶
func (w *ScrollWidget) Draw(p *tui.Painter)
func (*ScrollWidget) Scroll ¶
func (w *ScrollWidget) Scroll(x, y int)
type ScrollableWidget ¶
type UICoordinator ¶
type UICoordinator struct { Config *config.Config Api *restapi.Client LogID string UI tui.UI // contains filtered or unexported fields }
UICoordinator implements of Coordinator.
func (*UICoordinator) NotifyVMUpdated ¶
func (c *UICoordinator) NotifyVMUpdated()
func (*UICoordinator) Quit ¶
func (c *UICoordinator) Quit()
func (*UICoordinator) Run ¶
func (c *UICoordinator) Run() error
func (*UICoordinator) SetState ¶
func (c *UICoordinator) SetState(s UIState)
type UIState ¶
type UIState struct { LogID string RecordID types.FuncLogID Record types.FuncLog UseGraphView bool }
UIState is status of Coordinator.
type Updatable ¶
type Updatable interface { // Update()を呼び出す頻度。 // 負の値を返した場合、Update()は初回のみ呼び出され、それ以降の自動更新は行わない。 // 0を返した場合、DefaultUpdateIntervalの頻度でUpdate()を呼び出す。 // 正の値を返した場合、指定した頻度でUpdate()を呼び出す。 UpdateInterval() time.Duration // Update()は、キャッシュのアップデートを行う。 // 完了するまで長時間ブロックする可能性がある。 // ctxはnon-nilでなければならない。 Update(ctx context.Context) }
type View ¶
type View interface { // Widget creates widgets, and returns a parent widget. Widget() tui.Widget // Keybindings returns map of key-sequences and handlers. // If we do not necessarily set keybindings, it will return nil or empty map. Keybindings() map[string]func() // FocusChain returns tui.FocusChain. // You MUST call the View.Widget() before call this method. FocusChain() tui.FocusChain }
View interface creates widgets to build the user interface, and notify user inputs to ViewModel interface.
Click to show internal directories.
Click to hide internal directories.