Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTarget ¶
ParseTarget parses a target string into a normalized scheme and address/path.
func SetForceTCPListenerForTest ¶
func SetForceTCPListenerForTest(force bool)
SetForceTCPListenerForTest configures TCP listener forcing for testing.
Types ¶
type CandidateInfo ¶
type CandidateInfo struct {
ID string `json:"id,omitempty"`
Title string `json:"title"`
Artist string `json:"artist,omitempty"`
Source string `json:"source"`
Duration float64 `json:"duration_seconds,omitempty"`
Score int `json:"score,omitempty"`
WebpageURL string `json:"url,omitempty"`
}
CandidateInfo describes a candidate track found during search.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder wraps json.Decoder for reading NDJSON lines.
type Event ¶
type Event struct {
Timestamp time.Time `json:"timestamp"`
Type EventType `json:"type"`
Phase string `json:"phase,omitempty"`
Step int `json:"step,omitempty"`
TotalSteps int `json:"total_steps,omitempty"`
Message string `json:"message,omitempty"`
Percent float64 `json:"percent,omitempty"`
Track *TrackInfo `json:"track,omitempty"`
Candidate *CandidateInfo `json:"candidate,omitempty"`
Result *ResultInfo `json:"result,omitempty"`
Error string `json:"error,omitempty"`
}
Event represents an atomic structured telemetry/progress update sent over the socket.
type EventType ¶
type EventType string
EventType represents the category of a progress event.
const ( EventPhaseStart EventType = "phase_start" EventCandidateFound EventType = "candidate_found" EventCandidateSelected EventType = "candidate_selected" EventProgress EventType = "progress" EventComplete EventType = "complete" EventError EventType = "error" EventTrackStart EventType = "track_start" EventTrackComplete EventType = "track_complete" )
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter handles streaming progress events to a socket, file descriptor, or stream.
func NewReporter ¶
NewReporter connects to the specified progress target and returns a Reporter.
type ResultInfo ¶
type ResultInfo struct {
Path string `json:"path"`
Title string `json:"title,omitempty"`
Artist string `json:"artist,omitempty"`
Album string `json:"album,omitempty"`
ReleaseYear string `json:"release_year,omitempty"`
Duration float64 `json:"duration_seconds,omitempty"`
BandwidthHz int `json:"bandwidth_hz,omitempty"`
BandwidthRating string `json:"bandwidth_rating,omitempty"`
SuggestedGainDb float64 `json:"suggested_gain_db,omitempty"`
Status string `json:"status,omitempty"`
}
ResultInfo describes the final artifact and quality verification metrics.
type SocketServer ¶
type SocketServer struct {
// contains filtered or unexported fields
}
SocketServer receives progress events from a child process over a socket (UNIX or TCP).
func StartSocketServer ¶
StartSocketServer creates a progress socket listener. On POSIX systems, it uses a UNIX domain socket. On Windows or if UNIX sockets fail, it falls back to a local TCP socket (127.0.0.1:0).
func (*SocketServer) Close ¶
func (s *SocketServer) Close() error
Close gracefully stops the SocketServer, closes connections, and cleans up socket resources.
type TrackInfo ¶
type TrackInfo struct {
Index int `json:"index"`
TotalTracks int `json:"total_tracks"`
Artist string `json:"artist"`
Title string `json:"title"`
Timestamp string `json:"timestamp,omitempty"`
ActualFile string `json:"actual_file,omitempty"`
Status string `json:"status,omitempty"`
ErrorMessage string `json:"error,omitempty"`
}
TrackInfo describes a set-level track item.