api

package
v0.0.0-...-242787d Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package api defines the types for frontend-backend communication

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction string

Direction represents data direction

const (
	TX Direction = "TX"
	RX Direction = "RX"
)

type Mode

type Mode string

Mode represents application mode

const (
	ModeIdle    Mode = ""
	ModeRecord  Mode = "record"
	ModeCompare Mode = "compare"
)

type PortInfo

type PortInfo struct {
	PortPath string `json:"portPath"` // "/dev/ttys000"
	PortType string `json:"portType"` // "virtual", "physical"
}

PortInfo represents a serial port

type Record

type Record struct {
	Index int    `json:"index"`
	Dir   string `json:"dir"`  // "TX", "RX"
	Data  string `json:"data"` // hex encoded
	Size  int    `json:"size"`
	Match *bool  `json:"match,omitempty"` // only for actual
}

Record represents a data record

type State

type State struct {
	Mode       string     `json:"mode"` // "", "record", "compare"
	UpperPort  string     `json:"upperPort"`
	LowerPorts []PortInfo `json:"lowerPorts"`
	Baseline   []Record   `json:"baseline"`
	Actual     []Record   `json:"actual"`
	Stats      Stats      `json:"stats"`
}

State represents the complete application state

type Stats

type Stats struct {
	TX      int `json:"tx"`
	RX      int `json:"rx"`
	Matched int `json:"matched"`
	Diff    int `json:"diff"`
}

Stats represents statistics

Jump to

Keyboard shortcuts

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