hexdumper

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package hexdumper provides a widget which displays selectable hexdump-like output. Because it's built for termshark, it also allows styling to be applied to ranges of data intended to correspond to packet structure selected in another termshark view.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IHexBuilder

type IHexBuilder interface {
	Data() []byte
	Layers() []LayerStyler
	CursorUnselected() string
	CursorSelected() string
	LineNumUnselected() string
	LineNumSelected() string
}

type LayerStyler

type LayerStyler struct {
	Start         int
	End           int
	ColUnselected string
	ColSelected   string
}

type Options

type Options struct {
	StyledLayers      []LayerStyler
	CursorUnselected  string
	CursorSelected    string
	LineNumUnselected string
	LineNumSelected   string
	PaletteIfCopying  string
}

type PositionChangedCB

type PositionChangedCB struct{}

type Widget

type Widget struct {
	gowid.AddressProvidesID
	styled.UsePaletteIfSelectedForCopy
	Callbacks *gowid.Callbacks
	gowid.IsSelectable
	// contains filtered or unexported fields
}

func New

func New(data []byte, opts ...Options) *Widget

func (*Widget) Build

func (w *Widget) Build(curpos int) gowid.IWidget

func (*Widget) Clips

func (w *Widget) Clips(app gowid.IApp) []gowid.ICopyResult

func (*Widget) CursorSelected

func (w *Widget) CursorSelected() string

func (*Widget) CursorUnselected

func (w *Widget) CursorUnselected() string

func (*Widget) Data

func (w *Widget) Data() []byte

func (*Widget) InHex

func (w *Widget) InHex() bool

func (*Widget) Layers

func (w *Widget) Layers() []LayerStyler

func (*Widget) LineNumSelected

func (w *Widget) LineNumSelected() string

func (*Widget) LineNumUnselected

func (w *Widget) LineNumUnselected() string

func (*Widget) OnKey

func (w *Widget) OnKey(fn viewSwitchFn) viewSwitch

func (*Widget) OnPositionChanged

func (w *Widget) OnPositionChanged(f gowid.IWidgetChangedCallback)

func (*Widget) Position

func (w *Widget) Position() int

func (*Widget) RemoveOnPositionChanged

func (w *Widget) RemoveOnPositionChanged(f gowid.IIdentity)

func (*Widget) Render

func (w *Widget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas

func (*Widget) RenderSize

func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox

func (*Widget) SetData

func (w *Widget) SetData(data []byte, app gowid.IApp)

func (*Widget) SetInHex

func (w *Widget) SetInHex(val bool, app gowid.IApp)

func (*Widget) SetLayers

func (w *Widget) SetLayers(layers []LayerStyler, app gowid.IApp)

func (*Widget) SetPosition

func (w *Widget) SetPosition(pos int, app gowid.IApp)

func (*Widget) String

func (w *Widget) String() string

func (*Widget) UserInput

func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

Reject tab because I want it to switch views. Not intended to be transferable.

Jump to

Keyboard shortcuts

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