common

package
v0.0.0-...-9b6dc10 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AwaitEnter

func AwaitEnter() error

func BytesToString

func BytesToString(b []byte) string

func GetChannel

func GetChannel(id string) (*youtube.Channel, error)

func GetVideo

func GetVideo(id string) (youtube.VideoResult, error)

func Require

func Require[S ~[]E, E any](s S, capacity int) S

func Resize

func Resize[S ~[]E, E any](s S, length int) S

func Sha256

func Sha256(s string) string

func StringToBytes

func StringToBytes(s string) []byte

Types

type Channel

type Channel struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type ExportOptions

type ExportOptions struct {
	SkipSubscriptions bool `arg:"--skip-subscriptions"`
	SkipPlaylists     bool `arg:"--skip-playlists"`
}

type Migrator

type Migrator interface {
	ImportTo(data UserData) error
	ExportFrom(opts ExportOptions) (data UserData, err error)
}

type PlaylistTitle

type PlaylistTitle = string

type Playlists

type Playlists map[PlaylistTitle][]VideoID

type Subscriptions

type Subscriptions []Channel

type UserData

type UserData struct {
	Subscriptions Subscriptions `json:"subscriptions"`
	Playlists     Playlists     `json:"playlists"`
}

type VideoID

type VideoID = string

Jump to

Keyboard shortcuts

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