tui

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 28 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 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 {
	RequiredProcessedBlocks uint64
	ResolvedStartBlock      uint64
	// contains filtered or unexported fields
}

func New

func New(pkg *pbsubstreams.Package, outputStreamNames []string) (*TUI, error)

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) HandleBlockScopedData added in v1.16.2

func (ui *TUI) HandleBlockScopedData(ctx context.Context, data *pbsubstreamsrpc.BlockScopedData, isLive *bool, cursor *sink.Cursor) error

func (*TUI) HandleBlockUndoSignal added in v1.16.2

func (ui *TUI) HandleBlockUndoSignal(ctx context.Context, undoSignal *pbsubstreamsrpc.BlockUndoSignal, cursor *sink.Cursor) error

func (*TUI) HandleDebugSnapshotComplete added in v1.16.2

func (ui *TUI) HandleDebugSnapshotComplete(ctx context.Context, complete *pbsubstreamsrpc.InitialSnapshotComplete) error

func (*TUI) HandleDebugSnapshotData added in v1.16.2

func (ui *TUI) HandleDebugSnapshotData(ctx context.Context, debug *pbsubstreamsrpc.InitialSnapshotData) error

func (*TUI) HandleProgress added in v1.16.2

func (ui *TUI) HandleProgress(ctx context.Context, progress *pbsubstreamsrpc.ModulesProgress)

func (*TUI) HandleSession added in v1.16.2

func (ui *TUI) HandleSession(ctx context.Context, req *pbsubstreamsrpc.Request, session *pbsubstreamsrpc.SessionInit) error

func (*TUI) Init

func (ui *TUI) Init(outputMode string, bytesRepresentation dynamic.BytesRepresentation) 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)

func (*TUI) SetTestRunner added in v1.16.2

func (ui *TUI) SetTestRunner(testRunner *test.Runner)

Jump to

Keyboard shortcuts

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