view

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseView

func CloseView()

CloseView closes the current view.

func SetView

func SetView(viewIface View, noappend ...struct{})

SetView sets the current view.

Types

type BannerView

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

BannerView describes the layout of a banner view.

Banner stores the banner view properties.

func (*BannerView) Exit

func (b *BannerView) Exit() bool

Exit closes the banner view.

func (*BannerView) Init

func (b *BannerView) Init() bool

Init intializes the banner view.

func (*BannerView) Keybindings

func (b *BannerView) Keybindings(event *tcell.EventKey) *tcell.EventKey

Keybindings describes the banner view's keybindings.

func (*BannerView) Name

func (b *BannerView) Name() string

Name returns the name of the banner view.

func (*BannerView) Primitive

func (b *BannerView) Primitive() tview.Primitive

Primitive returns the primitive for the banner view.

func (*BannerView) Tabs

func (b *BannerView) Tabs() app.Tab

Tabs describes the tab layout for the banner view.

func (*BannerView) ThemeProperty added in v0.3.8

func (d *BannerView) ThemeProperty() theme.ThemeProperty

ThemeProperty returns the banner view's theme property.

type ChannelContinuation

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

ChannelContinuation describes the page/continuation data for the channel table.

type ChannelTable

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

ChannelTable describes the properties of a channel table.

type ChannelView

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

ChannelView describes the layout of a channel view.

var Channel ChannelView

Channel stores the channel view properties.

func (*ChannelView) EventHandler

func (c *ChannelView) EventHandler(pageType string, justView bool)

EventHandler shows the channel view according to the provided page type.

func (*ChannelView) Exit

func (c *ChannelView) Exit() bool

Exit closes the channel view

func (*ChannelView) Init

func (c *ChannelView) Init() bool

Init initializes the channel view.

func (*ChannelView) Keybindings

func (c *ChannelView) Keybindings(event *tcell.EventKey) *tcell.EventKey

Keybindings describes the keybindings for the channel view.

func (*ChannelView) Load

func (c *ChannelView) Load(pageType string, loadMore ...struct{})

Load loads the channel view according to the page type.

func (*ChannelView) Name

func (c *ChannelView) Name() string

Name returns the name of the channel view.

func (*ChannelView) Playlists

func (c *ChannelView) Playlists(id string, loadMore ...struct{}) (string, string, error)

Playlists loads the channel playlists.

func (*ChannelView) Primitive

func (c *ChannelView) Primitive() tview.Primitive

Primitive returns the primitive for the channel view.

func (*ChannelView) Query

func (c *ChannelView) Query()

Query prompts for a query and searches the channel.

func (*ChannelView) Releases added in v0.3.8

func (c *ChannelView) Releases(id string, loadMore ...struct{}) (string, string, error)

Releases loads the channel releases.

func (*ChannelView) Search

func (c *ChannelView) Search(text string)

Search searches for the provided query within the channel.

func (*ChannelView) Tabs

func (c *ChannelView) Tabs() app.Tab

Tabs describes the tab layout for the channel view.

func (*ChannelView) ThemeProperty added in v0.3.8

func (c *ChannelView) ThemeProperty() theme.ThemeProperty

ThemeProperty returns the channel view's theme property.

func (*ChannelView) Videos

func (c *ChannelView) Videos(id string, loadMore ...struct{}) (string, string, error)

Videos loads the channel videos.

func (*ChannelView) View

func (c *ChannelView) View(pageType string)

View shows the channel view.

type CommentsView

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

CommentsView describes the layout for a comments view.

var Comments CommentsView

Comments stores the properties of the comments view.

func (*CommentsView) Close

func (c *CommentsView) Close()

Close closes the comments view.

func (*CommentsView) Init

func (c *CommentsView) Init()

Init initializes the comments view.

func (*CommentsView) IsOpen added in v0.4.3

func (c *CommentsView) IsOpen() bool

IsOpen returns if the comments view is open.

func (*CommentsView) Keybindings

func (c *CommentsView) Keybindings(event *tcell.EventKey) *tcell.EventKey

Keybindings describes the keybindings for the comments view.

func (*CommentsView) Load

func (c *CommentsView) Load(id, title string)

Load loads the comments from the given video.

func (*CommentsView) Show

func (c *CommentsView) Show()

Show shows the comments view.

func (*CommentsView) Subcomments

func (c *CommentsView) Subcomments(selected, removed *tview.TreeNode, continuation string)

Subcomments loads the subcomments for the currently selected comment.

type DashboardTable

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

DashboardTable describes the properties of a dashboard table.

type DashboardView

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

DashboardView describes the layout for a dashboard view.

var Dashboard DashboardView

Dashboard stores the dashboard view properties.

func (*DashboardView) AuthPage

func (d *DashboardView) AuthPage()

AuthPage shows the authentication page.

func (*DashboardView) CurrentPage

func (d *DashboardView) CurrentPage(page ...string) string

CurrentPage returns the dashboard's current page.

func (*DashboardView) EventHandler

func (d *DashboardView) EventHandler()

EventHandler checks whether authentication is needed before showing the dashboard view.

func (*DashboardView) Exit

func (d *DashboardView) Exit() bool

Exit closes the dashboard view.

func (*DashboardView) Init

func (d *DashboardView) Init() bool

Init initializes the dashboard view.

func (*DashboardView) IsFocused

func (d *DashboardView) IsFocused() bool

IsFocused returns if the dashboard view is focused or not.

func (*DashboardView) Keybindings

func (d *DashboardView) Keybindings(event *tcell.EventKey) *tcell.EventKey

Keybindings defines the keybindings for the dashboard view.

func (*DashboardView) Load

func (d *DashboardView) Load(pageType string, reload ...struct{})

Load loads the dashboard view according to the provided page type.

func (*DashboardView) ModifyHandler

func (d *DashboardView) ModifyHandler(add bool)

ModifyHandler handles the following activities: - Adding/removing videos to/from a user playlist - Deleting user playlists - Subscribing/unsubscribing to/from channels

func (*DashboardView) Name

func (d *DashboardView) Name() string

Name returns the name of the dashboard view.

func (*DashboardView) PlaylistForm

func (d *DashboardView) PlaylistForm(edit bool)

PlaylistForm displays a form to create/edit a user playlist.

func (*DashboardView) Primitive

func (d *DashboardView) Primitive() tview.Primitive

Primitive returns the primitive for the dashboard view.

func (*DashboardView) Tabs

func (d *DashboardView) Tabs() app.Tab

Tabs describes the tab layout for the dashboard view.

func (*DashboardView) ThemeProperty added in v0.3.8

func (d *DashboardView) ThemeProperty() theme.ThemeProperty

ThemeProperty returns the dashboard view's theme property.

func (*DashboardView) View

func (d *DashboardView) View(auth ...struct{})

View shows the dashboard view.

type DownloadData

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

DownloadData describes the information for the downloading item.

type DownloadItem added in v0.3.8

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

type DownloadProgress

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

DownloadProgress describes the layout of a progress indicator.

func (*DownloadProgress) Write

func (p *DownloadProgress) Write(b []byte) (int, error)

Write generates the progress bar.

type DownloadsView

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

DownloadsView describes the layout of a downloads view.

var Downloads DownloadsView

Downloads stores the downloads view properties.

func (*DownloadsView) Exit

func (d *DownloadsView) Exit() bool

Exit closes the downloads view.

func (*DownloadsView) Init

func (d *DownloadsView) Init() bool

Init initializes the downloads view.

func (*DownloadsView) IsInitialized added in v0.3.8

func (d *DownloadsView) IsInitialized() bool

IsInitialized returns whether the downloads view is initialized.

func (*DownloadsView) IsPageOpen added in v0.4.3

func (d *DownloadsView) IsPageOpen() bool

func (*DownloadsView) Keybindings

func (d *DownloadsView) Keybindings(event *tcell.EventKey) *tcell.EventKey

Keybindings describes the keybindings for the downloads view.

func (*DownloadsView) LoadOptions

func (d *DownloadsView) LoadOptions(id, title string)

LoadOptions loads the download options for the selected video.

func (*DownloadsView) Name

func (d *DownloadsView) Name() string

Name returns the name of the downloads view.

func (*DownloadsView) OptionKeybindings

func (d *DownloadsView) OptionKeybindings(event *tcell.EventKey) *tcell.EventKey

OptionKeybindings describes the keybindings for the download options popup.

func (*DownloadsView) Primitive

func (d *DownloadsView) Primitive() tview.Primitive

Primitive returns the primitive for the downloads view.

func (*DownloadsView) SetDir added in v0.3.3

func (d *DownloadsView) SetDir(info ...inv.SearchData)

SetDir sets the download directory.

func (*DownloadsView) ShowOptions

func (d *DownloadsView) ShowOptions(data ...inv.SearchData)

ShowOptions shows a list of download options for the selected video.

func (*DownloadsView) Tabs

func (d *DownloadsView) Tabs() app.Tab

Tabs describes the tab layout for the downloads view.

func (*DownloadsView) ThemeProperty added in v0.3.8

func (d *DownloadsView) ThemeProperty() theme.ThemeProperty

ThemeProperty returns the download view's theme property.

func (*DownloadsView) TransferPlaylist added in v0.3.6

func (d *DownloadsView) TransferPlaylist(id, file string, flags int, auth, appendToFile bool) (string, int, error)

TransferPlaylist starts the download for the selected playlist.

func (*DownloadsView) TransferVideo added in v0.3.6

func (d *DownloadsView) TransferVideo(id, itag, filename string)

TransferVideo starts the download for the selected video.

func (*DownloadsView) View

func (d *DownloadsView) View()

View shows the download view.

type InfoView

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

InfoView describes the layout for a playlist/channel page. It displays a title, description and the entries.

func (*InfoView) Init

func (i *InfoView) Init(primitive tview.Primitive, property theme.ThemeProperty)

Init initializes the info view.

func (*InfoView) Set

func (i *InfoView) Set(title, description string)

Set sets the title and description of the info view.

type PlaylistView

type PlaylistView struct {
	ID string
	// contains filtered or unexported fields
}

PlaylistView describes the layout of a playlist view.

var Playlist PlaylistView

Playlist stores the playlist view properties.

func (*PlaylistView) EventHandler

func (p *PlaylistView) EventHandler(justView, auth bool, loadMore ...struct{})

EventHandler shows the playlist view for the currently selected playlist.

func (*PlaylistView) Exit

func (p *PlaylistView) Exit() bool

Exit closes the playlist view.

func (*PlaylistView) Init

func (p *PlaylistView) Init() bool

Init initializes the playlist view.

func (*PlaylistView) Keybindings

func (p *PlaylistView) Keybindings(event *tcell.EventKey) *tcell.EventKey

Keybindings describes the keybindings for the playlist view.

func (*PlaylistView) Load

func (p *PlaylistView) Load(id string, loadMore ...struct{})

Load loads the playlist.

func (*PlaylistView) Name

func (p *PlaylistView) Name() string

Name returns the name of the playlist view.

func (*PlaylistView) Primitive

func (p *PlaylistView) Primitive() tview.Primitive

Primitive returns the primitive for the playlist view.

func (*PlaylistView) Save added in v0.3.6

func (p *PlaylistView) Save(id string, auth bool)

Save downloads and saves the playlist to a file.

func (*PlaylistView) Tabs

func (p *PlaylistView) Tabs() app.Tab

Tabs returns the tab layout for the playlist view.

func (*PlaylistView) ThemeProperty added in v0.3.8

func (p *PlaylistView) ThemeProperty() theme.ThemeProperty

ThemeProperty returns the playlist view's theme property.

func (*PlaylistView) View

func (p *PlaylistView) View()

View shows the playlist view.

type SearchView

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

SearchView describes the layout for a search view.

var (
	// Search stores the search view properties
	Search SearchView
)

func (*SearchView) Exit

func (s *SearchView) Exit() bool

Exit closes the search view.

func (*SearchView) Init

func (s *SearchView) Init() bool

Init initializes the search view.

func (*SearchView) Keybindings

func (s *SearchView) Keybindings(event *tcell.EventKey) *tcell.EventKey

Keybindings describes the keybindings for the search view.

func (*SearchView) Name

func (s *SearchView) Name() string

Name returns the name of the search view.

func (*SearchView) Parameters

func (s *SearchView) Parameters()

Parameters displays a popup to modify the search parameters.

func (*SearchView) ParseQuery

func (s *SearchView) ParseQuery()

ParseQuery parses the 'search-video', 'search-playlist' and 'search-channel' command-line parameters.

func (*SearchView) Primitive

func (s *SearchView) Primitive() tview.Primitive

Primitive returns the primitive for the search view.

func (*SearchView) Query

func (s *SearchView) Query(switchMode ...struct{})

Query displays a prompt and search for the provided query.

func (*SearchView) Start

func (s *SearchView) Start(text string)

Start shows the search view and fetches results for the search query.

func (*SearchView) Suggestions

func (s *SearchView) Suggestions(text string)

Suggestions shows search suggestions.

func (*SearchView) Tabs

func (s *SearchView) Tabs() app.Tab

Tabs returns the tab layout for the search view.

func (*SearchView) ThemeProperty added in v0.3.8

func (d *SearchView) ThemeProperty() theme.ThemeProperty

ThemeProperty returns the search view's theme property.

type View

type View interface {
	Name() string
	Tabs() app.Tab
	Init() bool
	Exit() bool

	Keybindings(event *tcell.EventKey) *tcell.EventKey
	Primitive() tview.Primitive
	ThemeProperty() theme.ThemeProperty
}

View describes a view.

func GetCurrentView

func GetCurrentView() View

GetCurrentView returns the current view.

func PreviousView

func PreviousView() View

PreviousView returns the view before the one currently displayed.

Jump to

Keyboard shortcuts

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