tui

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connecting msg = iota
	Connected

	Quit
)

Variables

View Source
var ErrInvalidOutputMode = fmt.Errorf("not a valid OutputMode, try [%s]", strings.Join(_OutputModeNames, ", "))

Functions

func OutputModeNames added in v0.1.0

func OutputModeNames() []string

OutputModeNames returns a list of possible string values of OutputMode.

Types

type BlockMessage

type BlockMessage string

type DeltaWrap added in v0.0.14

type DeltaWrap struct {
	Operation string          `json:"op"`
	Ordinal   uint64          `json:"ordinal"`
	Key       string          `json:"key"`
	OldValue  json.RawMessage `json:"old"`
	NewValue  json.RawMessage `json:"new"`
}

type DeltasWrap added in v0.0.14

type DeltasWrap struct {
	Module   string      `json:"@module"`
	BlockNum uint64      `json:"@block,omitempty"`
	Deltas   []DeltaWrap `json:"@deltas"`
}

type ErrorWrap added in v0.0.14

type ErrorWrap struct {
	Module string `json:"@module,omitempty"`
	Error  string `json:"@error"`
	String string `json:"@str"`
	Bytes  []byte `json:"@bytes"`
}

type ModuleWrap added in v0.0.14

type ModuleWrap struct {
	Module   string          `json:"@module"`
	BlockNum uint64          `json:"@block"`
	Type     string          `json:"@type"`
	Data     json.RawMessage `json:"@data"`
}

type OutputMode added in v0.1.0

type OutputMode uint

ENUM(TUI, JSON, JSONL, CLOCK, CURSOR)

const (
	// OutputModeTUI is a OutputMode of type TUI.
	OutputModeTUI OutputMode = iota
	// OutputModeJSON is a OutputMode of type JSON.
	OutputModeJSON
	// OutputModeJSONL is a OutputMode of type JSONL.
	OutputModeJSONL
	// OutputModeCLOCK is a OutputMode of type CLOCK.
	OutputModeCLOCK
	// OutputModeCURSOR is a OutputMode of type CURSOR.
	OutputModeCURSOR
)

func ParseOutputMode added in v0.1.0

func ParseOutputMode(name string) (OutputMode, error)

ParseOutputMode attempts to convert a string to a OutputMode.

func (OutputMode) IsValid added in v1.0.2

func (x OutputMode) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (OutputMode) MarshalText added in v0.1.0

func (x OutputMode) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (OutputMode) String added in v0.1.0

func (x OutputMode) String() string

String implements the Stringer interface.

func (*OutputMode) UnmarshalText added in v0.1.0

func (x *OutputMode) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type SessionInitMessage added in v0.1.0

type SessionInitMessage struct {
	TraceID string
}

type SnapshotDeltaWrap added in v0.0.14

type SnapshotDeltaWrap struct {
	Module   string    `json:"@module"`
	Progress string    `json:"@progress"`
	Delta    DeltaWrap `json:"@delta"`
}

type TUI

type TUI struct {
	TotalReadBytes uint64
	// contains filtered or unexported fields
}

func New

func New(req *pbsubstreamsrpc.Request, pkg *pbsubstreams.Package, outputStreamNames []string) *TUI

func (*TUI) Cancel

func (ui *TUI) Cancel()

func (*TUI) CleanUpTerminal

func (ui *TUI) CleanUpTerminal()

func (*TUI) Connected

func (ui *TUI) Connected()

func (*TUI) Connecting

func (ui *TUI) Connecting()

func (*TUI) IncomingMessage

func (ui *TUI) IncomingMessage(ctx context.Context, resp *pbsubstreamsrpc.Response, testRunner *test.Runner) error

func (*TUI) Init

func (ui *TUI) Init(outputMode string) error

func (*TUI) OnTerminated added in v0.1.0

func (ui *TUI) OnTerminated(f func(error))

func (*TUI) SetRequest

func (ui *TUI) SetRequest(req *pbsubstreamsrpc.Request)

type UnknownWrap added in v0.0.14

type UnknownWrap struct {
	Module      string `json:"@module"`
	UnknownType string `json:"@unknown"`
	String      string `json:"@str"`
	Bytes       []byte `json:"@bytes"`
}

Jump to

Keyboard shortcuts

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