views

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TabSize = 4
)

Functions

func Load

func Load(filename string, replayview *ReplayView, prox *ProxyView, sitemap *SiteMapView) bool

Load - needs to read a json file, clear out the proxy and replay tables and repopulate them

func Save

func Save(filename string, replayview *ReplayView, proxy *ProxyView) bool

Save - spool the replay and proxy state off to a file

Types

type ProxyView

type ProxyView struct {
	Layout *tview.Pages // The main replay view, all others should be underneath Layout
	Table  *tview.Table // the proxy history table

	Logger *modifier.Logger // the Martian logger
	// contains filtered or unexported fields
}

ProxyView - struct that holds the main prox elements

func (*ProxyView) AddEntry added in v0.1.3

func (view *ProxyView) AddEntry(e *modifier.Entry, t int)

AddEntry - add a modifier entry to the proxy table, t indicates request, response or save/load

func (*ProxyView) GetView

func (view *ProxyView) GetView() (title string, content tview.Primitive)

GetView - should return a title and the top-level primitive

func (*ProxyView) Init

func (view *ProxyView) Init(app *tview.Application, replayview *ReplayView, logger *modifier.Logger,
	channel chan modifier.Notification)

Init - Main initialization method for the proxy view

type ReplayRequests added in v0.1.7

type ReplayRequests struct {
	ID string // The ID as displayed in the table
	// contains filtered or unexported fields
}

ReplayRequests - hold an array of requests for a replay item and the currently selected array ID

type ReplaySaves added in v0.1.7

type ReplaySaves struct {
	ID       string           // The ID as displayed in the table
	Entries  []replay.Request // an array of replay requests
	Selected int              // the currently selected request
}

Like ReplayRequests, but we want to store each replay directly in here

type ReplayView

type ReplayView struct {
	Layout *tview.Pages // The main replay view, all others should be underneath Layout
	Table  *tview.Table // the main table that lists all the replay items
	// contains filtered or unexported fields
}

ReplayView - struct that holds the main replayview elements

func (*ReplayView) AddItem

func (view *ReplayView) AddItem(r *replay.Request)

AddItem method - create a new replay entry

func (*ReplayView) DeleteItem added in v0.1.4

func (view *ReplayView) DeleteItem(rr *ReplayRequests)

DeleteItem - delete an entry

func (*ReplayView) GetView

func (view *ReplayView) GetView() (title string, content tview.Primitive)

GetView - should return a title and the top-level primitive

func (*ReplayView) Init

func (view *ReplayView) Init(app *tview.Application)

Init - Initialization method for the replayer view

func (*ReplayView) LoadReplays added in v0.1.7

func (view *ReplayView) LoadReplays(rr *ReplayRequests)

func (*ReplayView) RenameItem

func (view *ReplayView) RenameItem(rr *ReplayRequests, newName string)

RenameItem - change the name of an entry

type SaveRestoreView

type SaveRestoreView struct {
	Layout *tview.Pages
}

SaveRestoreView - the main struct for the view

func (*SaveRestoreView) GetView

func (view *SaveRestoreView) GetView() (title string, content tview.Primitive)

GetView - should return a title and the top-level primitive

func (*SaveRestoreView) Init

func (view *SaveRestoreView) Init(app *tview.Application, replays *ReplayView, proxy *ProxyView, sitemap *SiteMapView)

Init - Initialize the save view

type SiteMapView added in v0.1.4

type SiteMapView struct {
	Layout *tview.Pages

	Logger *modifier.Logger // the Martian logger
	// contains filtered or unexported fields
}

SiteMapView - the main struct for the view

func (*SiteMapView) GetView added in v0.1.4

func (view *SiteMapView) GetView() (title string, content tview.Primitive)

GetView - should return a title and the top-level primitive

func (*SiteMapView) Init added in v0.1.4

func (view *SiteMapView) Init(app *tview.Application, logger *modifier.Logger, channel chan modifier.Notification)

Init - Initialize the save view

type TextPrimitive added in v0.1.5

type TextPrimitive struct {
	sync.Mutex
	*tview.Box
	// contains filtered or unexported fields
}

TextPrimitive is a basic, line wrapped text view that is designed to replicate a severely cut down version of tview's TextView, removing color support, grapheme cluster handling, regions and other functionality with the aim of increasing performance and being able to handle megabytes of data with wrapping. You probably don't want to use this. See: https://github.com/rivo/tview/issues/686

func NewTextPrimitive added in v0.1.5

func NewTextPrimitive() *TextPrimitive

func (*TextPrimitive) Clear added in v0.1.5

func (t *TextPrimitive) Clear()

func (*TextPrimitive) Draw added in v0.1.5

func (t *TextPrimitive) Draw(screen tcell.Screen)

func (*TextPrimitive) InputHandler added in v0.1.5

func (t *TextPrimitive) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*TextPrimitive) MouseHandler added in v0.1.5

func (t *TextPrimitive) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

func (*TextPrimitive) ScrollToBeginning added in v0.1.5

func (t *TextPrimitive) ScrollToBeginning()

func (*TextPrimitive) Write added in v0.1.5

func (t *TextPrimitive) Write(p []byte) (n int, err error)

Write lets us implement the io.Writer interface. Tab characters will be replaced with TabSize space characters. A "\n" or "\r\n" will be interpreted as a new line.

type ViewFilter added in v0.1.3

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

ViewFilter - specify a match pattern and whether to include or exclude the pattern

Jump to

Keyboard shortcuts

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