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

View Source
const (
	ContentTypeVideos    = ContentType("videos")
	ContentTypeShorts    = ContentType("shorts")
	ContentTypeLive      = ContentType("live")
	ContentTypeUndefined = ContentType("")
)

Variables

This section is empty.

Functions

func WithContentType

func WithContentType(contentType ContentType) getChannelVideosOption

func WithLang

func WithLang(lang string) getChannelVideosOption

Types

type Client

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

func New

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

func (*Client) GetChannelVideos

func (c *Client) GetChannelVideos(channelID string, opts ...getChannelVideosOption) ([]Video, error)

type ContentType

type ContentType 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"`
	Moving bool   `json:"moving"`
}

type Video

type Video struct {
	Type              string      `json:"type"`
	ID                string      `json:"id"`
	Title             string      `json:"title"`
	IsLiveNow         bool        `json:"isLiveNow"`
	LengthText        string      `json:"lengthText"`
	ViewCountText     string      `json:"viewCountText"`
	PublishedTimeText string      `json:"publishedTimeText"`
	Thumbnails        []Thumbnail `json:"thumbnails"`
}

Jump to

Keyboard shortcuts

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