Documentation
¶
Overview ¶
Package ipc implements the stdio JSON-RPC protocol between the Tauri shell and the sidecar.
Index ¶
- func RegisterConfigHandlers(s *Server, store *storage.Client, onChange OnConfigChange)
- func RegisterCoreHandlers(s *Server)
- func RegisterOutageHandlers(s *Server, store *storage.Client)
- func RegisterReportHandlers(s *Server, store *storage.Client)
- func RegisterSampleHandlers(s *Server, store *storage.Client)
- func RegisterTargetHandlers(s *Server, store *storage.Client, onDisabled OnTargetDisabled)
- func RegisterWifiHandlers(s *Server, store *storage.Client)
- type Error
- type Event
- type GatewayInfo
- type Handler
- type HealthCheckResult
- type OnConfigChange
- type OnTargetDisabled
- type Request
- type Response
- type SamplesQueryResponse
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterConfigHandlers ¶
func RegisterConfigHandlers(s *Server, store *storage.Client, onChange OnConfigChange)
RegisterConfigHandlers wires config.get and config.update.
func RegisterCoreHandlers ¶
func RegisterCoreHandlers(s *Server)
RegisterCoreHandlers wires methods that don't depend on storage.
func RegisterOutageHandlers ¶
RegisterOutageHandlers wires outages.list. Defaults to the last 7 days.
func RegisterReportHandlers ¶
RegisterReportHandlers wires report.generate.
func RegisterSampleHandlers ¶
RegisterSampleHandlers wires samples.query. See pickGranularity for auto-resolution rules.
func RegisterTargetHandlers ¶
func RegisterTargetHandlers(s *Server, store *storage.Client, onDisabled OnTargetDisabled)
RegisterTargetHandlers wires targets.list/create/update/delete.
Pass onDisabled=nil to skip the open-outage closure side-effect.
func RegisterWifiHandlers ¶
RegisterWifiHandlers wires wifi.list.
Types ¶
type Event ¶
Event is an unsolicited message from the sidecar (no id, distinguishes from Response).
Tauri 2 event names: alphanumerics + `-/:_` only. Use `:` for namespacing; `.` silently drops.
type GatewayInfo ¶ added in v0.1.1
GatewayInfo is the payload returned by system.gateway.
type HealthCheckResult ¶
type HealthCheckResult struct {
Status string `json:"status"`
Version string `json:"version"`
Commit string `json:"commit,omitempty"`
}
HealthCheckResult is the payload returned by health.check.
type OnConfigChange ¶
OnConfigChange fires after a successful config.update. Free function type to avoid a monitor → ipc import cycle.
type OnTargetDisabled ¶ added in v0.1.2
type OnTargetDisabled func(scope string)
OnTargetDisabled fires after a successful targets.update that flips a target from enabled to disabled. Lets the app layer close any open outage rows for the target's scope — a disabled probe produces no more samples, so the normal recovery hold-off can't fire.
type Request ¶
type Request struct {
ID string `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
Request is an inbound method call from the Tauri shell.
type Response ¶
type Response struct {
ID string `json:"id"`
Result any `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Response is the reply to a Request. Exactly one of Result or Error is set.
type SamplesQueryResponse ¶
SamplesQueryResponse tags rows with their granularity so the frontend knows the row shape. Rows is []storage.Sample when granularity=="raw", otherwise []storage.AggregatedRow.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server dispatches JSON-RPC requests read from in and writes responses + events to out.