Documentation
¶
Index ¶
- Constants
- func WriteLocal(r *Report) (string, error)
- func WriteLocalToDir(r *Report, dir string) (string, error)
- type CPU
- type ClientGeo
- type Consent
- type Display
- type Error
- type GPU
- type Jitter
- type LatencyResult
- type Loss
- type MTUResult
- type Machine
- type Memory
- type Network
- type NetworkAdapter
- type OS
- type POPResult
- type Peripherals
- type Power
- type Reachability
- type Report
- type Security
- type Storage
- type Throughput
- type USBDevice
- type User
- type Virtualisation
Constants ¶
const ( Schema = "techcheck.v1" ToolVersion = "0.1.13" AppID = "sunrise-techcheck" )
const ( NetworkAdapterWired = "wired" NetworkAdapterWireless = "wireless" )
NetworkAdapterType values. Stored as strings on the wire per PRD §7.4.
const ( LatencyMethodICMP = "icmp" LatencyMethodTCP = "tcp" )
LatencyMethod values — which measurement technique the tool actually used.
const ( MTUStatusPass = "pass" MTUStatusFragmented = "fragmented" MTUStatusBlackHole = "black-hole" )
MTUStatus values.
const ( ReachabilityReachable = "reachable" ReachabilityBlocked = "blocked" )
ReachabilityStatus values.
Variables ¶
This section is empty.
Functions ¶
func WriteLocal ¶
WriteLocal writes the report to the user's Desktop with a filename built from the user name and a UTC timestamp. Returns the absolute path. The local file is the evidence-trail fallback mentioned in PRD §5.2 — it exists even when upload succeeds, so the user can inspect exactly what was sent.
Types ¶
type ClientGeo ¶
type ClientGeo struct {
City string `json:"city"`
Region string `json:"region"`
Country string `json:"country"` // ISO 3166-1 alpha-2
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
ISP string `json:"isp"`
}
ClientGeo is the client-side geolocation based on the user's public IP, looked up via ipinfo.io. All fields zero-value on lookup failure.
type LatencyResult ¶
type MTUResult ¶
type MTUResult struct {
Status string `json:"status"` // "pass" | "fragmented" | "black-hole"
}
type Machine ¶
type Machine struct {
OS OS `json:"os"`
MachineID string `json:"machine_id"`
Hostname string `json:"hostname"`
LoggedInUsername string `json:"logged_in_username"`
Locale string `json:"locale"`
Timezone string `json:"timezone"`
CPU CPU `json:"cpu"`
Memory Memory `json:"memory"`
Storage Storage `json:"storage"`
GPUs []GPU `json:"gpus"`
Displays []Display `json:"displays"`
Peripherals Peripherals `json:"peripherals"`
Virtualisation Virtualisation `json:"virtualisation"`
Power Power `json:"power"`
NetworkAdapters []NetworkAdapter `json:"network_adapters"`
Security Security `json:"security"`
}
type NetworkAdapter ¶
type POPResult ¶
type POPResult struct {
ID string `json:"id"`
RegionLabel string `json:"region_label"`
Latency LatencyResult `json:"latency"`
Throughput Throughput `json:"throughput"`
Jitter Jitter `json:"jitter"`
Loss Loss `json:"loss"`
MTU MTUResult `json:"mtu"`
ClockSkewMS int64 `json:"clock_skew_ms"`
UDP4172 Reachability `json:"udp_4172"`
TCP443 Reachability `json:"tcp_443"`
DNSMS int64 `json:"dns_ms"`
}
type Peripherals ¶
type Reachability ¶
type Reachability struct {
Status string `json:"status"` // "reachable" | "blocked"
}
type Report ¶
type Report struct {
Schema string `json:"schema"`
ToolVersion string `json:"tool_version"`
AppID string `json:"app_id"`
RunID string `json:"run_id"`
RunStartedAt time.Time `json:"run_started_at"`
RunCompletedAt time.Time `json:"run_completed_at"`
Consent Consent `json:"consent"`
User User `json:"user"`
Machine Machine `json:"machine"`
Network Network `json:"network"`
Errors []Error `json:"errors"`
}
Report is the top-level structure matching PRD §7.4.
func New ¶
func New() *Report
New returns a fresh Report with Schema, ToolVersion, RunID, and RunStartedAt populated, and initialised collections so JSON never contains null slices.
func (*Report) RecordError ¶
RecordError appends a per-test failure to r.Errors. popID may be empty for errors not attributable to a specific POP (e.g. sysinfo collection).
type Storage ¶
type Storage struct {
SystemVolumeFreeBytes uint64 `json:"system_volume_free_bytes"`
}
type Throughput ¶
type USBDevice ¶
type USBDevice struct {
Name string `json:"name"`
Manufacturer string `json:"manufacturer"`
VendorID string `json:"vendor_id"` // "0x05ac"
ProductID string `json:"product_id"` // "0x8600"
Speed string `json:"speed"` // "Up to 480 Mb/sec"
}
USBDevice describes a single attached USB peripheral. Serial numbers are intentionally omitted — they're a stable hardware identifier beyond machine_id and aren't needed for an IT tech check.