api

package
v0.0.0-...-1d835b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2023 License: 0BSD Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLang

func WithLang(lang string) getTranscriptOption

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(apiKey string, opts ...Option) (*Client, error)

func (*Client) GetTranscript

func (c *Client) GetTranscript(videoID string, opts ...getTranscriptOption) (*GetTranscriptResponse, error)

type GetTranscriptResponse

type GetTranscriptResponse struct {
	Title           string          `json:"title"`
	Description     string          `json:"description"`
	AvailableLangs  []string        `json:"availableLangs"`
	LengthInSeconds string          `json:"lengthInSeconds"`
	Thumbnails      []Thumbnail     `json:"thumbnails"`
	Transcription   []Transcription `json:"transcription"`
}

func (*GetTranscriptResponse) String

func (g *GetTranscriptResponse) String() string

GetTranscriptResponse.String()

type Option

type Option func(option *options) error

func WithHost

func WithHost(host string) Option

func WithHttpClient

func WithHttpClient(hc http.Client) Option

func WithRateLimit

func WithRateLimit(rl ratelimit.Limiter) Option

type Thumbnail

type Thumbnail struct {
	URL    string `json:"url"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

type Transcription

type Transcription struct {
	Subtitle string  `json:"subtitle"`
	Start    float64 `json:"start"`
	Dur      float64 `json:"dur"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL