feat: upload audio, get a private Swedish transcript, discuss it (#33, ADR-033) #39
@@ -175,6 +175,32 @@ type Reconciliation struct {
|
||||
Contested []ContestedSpot `json:"contested,omitempty"`
|
||||
}
|
||||
|
||||
// StepState is where one phase of an upload job stands (ADR-035).
|
||||
type StepState string
|
||||
|
||||
const (
|
||||
StepPending StepState = "pending"
|
||||
StepRunning StepState = "running"
|
||||
StepDone StepState = "done"
|
||||
StepFailed StepState = "failed"
|
||||
// StepSkipped is a step that never ran because the job finished without it, for
|
||||
// example the second engine's step when the first engine's text was used alone.
|
||||
StepSkipped StepState = "skipped"
|
||||
)
|
||||
|
||||
// ProgressStep is one named phase of an upload job. Total is zero for a phase with no
|
||||
// count; only a phase whose work is really countable carries one (ADR-035: no
|
||||
// percentage that does not come from real counts).
|
||||
type ProgressStep struct {
|
||||
Key string `json:"key"`
|
||||
Label string `json:"label"`
|
||||
State StepState `json:"state"`
|
||||
StartedAt time.Time `json:"started_at,omitzero"`
|
||||
FinishedAt time.Time `json:"finished_at,omitzero"`
|
||||
Done int `json:"done,omitempty"`
|
||||
Total int `json:"total,omitempty"`
|
||||
}
|
||||
|
||||
// UploadStatus is the state of an uploaded-audio transcription job.
|
||||
type UploadStatus string
|
||||
|
||||
@@ -218,6 +244,13 @@ type UploadedTranscript struct {
|
||||
// Reconciliation is how a merged transcript came about, or nil for a single
|
||||
// engine (ADR-034). Set by Get, not by List.
|
||||
Reconciliation *Reconciliation
|
||||
CreatedAt time.Time
|
||||
FinishedAt time.Time // zero until the job reaches done or failed
|
||||
// Progress is the job's phases, in order. Set by Get, not by List (ADR-035).
|
||||
Progress []ProgressStep
|
||||
// ProgressAt is when a phase last really changed or advanced; AliveAt is the
|
||||
// heartbeat. They differ on purpose: alive says the service is still reporting,
|
||||
// progress says work is moving (ADR-035). Both are zero until the job starts.
|
||||
ProgressAt time.Time
|
||||
AliveAt time.Time
|
||||
CreatedAt time.Time
|
||||
FinishedAt time.Time // zero until the job reaches done or failed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user