Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseFormatter ¶
type BaseFormatter struct {
IncludeTimestamps bool
}
type Formatter ¶
type Formatter interface {
Format(transcripts []yt_transcript_models.Transcript) (string, error)
}
type FormatterOption ¶
type FormatterOption func(f *BaseFormatter)
func WithTimestamps ¶
func WithTimestamps(include bool) FormatterOption
type JSONFormatter ¶
type JSONFormatter struct { BaseFormatter PrettyPrint bool }
func NewJSONFormatter ¶
func NewJSONFormatter(baseOptions ...FormatterOption) *JSONFormatter
func (*JSONFormatter) Configure ¶
func (f *JSONFormatter) Configure(options ...JSONFormatterOption)
func (*JSONFormatter) Format ¶
func (f *JSONFormatter) Format(transcripts []yt_transcript_models.Transcript) (string, error)
type JSONFormatterOption ¶
type JSONFormatterOption func(*JSONFormatter)
func WithPrettyPrint ¶
func WithPrettyPrint(pretty bool) JSONFormatterOption
type JSONTranscriptLine ¶
type JSONTranscripts ¶
type JSONTranscripts struct { LanguageCode string `json:"language_code"` Transcripts []JSONTranscriptLine `json:"transcripts"` }
type TextFormatter ¶
type TextFormatter struct {
BaseFormatter
}
func NewTextFormatter ¶
func NewTextFormatter(options ...FormatterOption) *TextFormatter
func (*TextFormatter) Format ¶
func (t *TextFormatter) Format(transcripts []yt_transcript_models.Transcript) (string, error)
Click to show internal directories.
Click to hide internal directories.