feat: git init

This commit is contained in:
2026-01-17 19:18:58 -06:00
commit b73d5b8078
18 changed files with 1274 additions and 0 deletions

33
pkg/output/formatter.go Normal file
View File

@@ -0,0 +1,33 @@
package output
import (
"transcribe/internal/whisper"
)
// Formatter interface for converting transcription results to various output formats
type Formatter interface {
Format(result *whisper.TranscriptionResult) (string, error)
}
// FormatType represents the output format type
type FormatType string
const (
FormatText FormatType = "text"
FormatSRT FormatType = "srt"
FormatJSON FormatType = "json"
)
// NewFormatter creates a formatter for the given format type
func NewFormatter(format FormatType) Formatter {
switch format {
case FormatSRT:
return &SRTFormatter{}
case FormatJSON:
return &JSONFormatter{}
case FormatText:
fallthrough
default:
return &TextFormatter{}
}
}