tui

package
v0.0.0-...-09a8973 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

This file will contain all the choices a player can have while interacting with tui

Copyright © 2022 Shubh Karman Singh <sksingh2211@gmail.com> All rights reserved. This Project is under BSD-3 License Clause. Look at License for more detail.

Copyright © 2022 Shubh Karman Singh <sksingh2211@gmail.com> All rights reserved. This Project is under BSD-3 License Clause. Look at License for more detail.

Index

Constants

View Source
const (
	MOVIE_RESULTS_TITLE = "Movie Results"
)

Variables

This section is empty.

Functions

func GetMagnetFromListModel

func GetMagnetFromListModel() string

func GetPlayerChoice

func GetPlayerChoice() string

func RenderListModelView

func RenderListModelView(title string, results scraper.Results) (err error)

This method is used to render ListModel View once query results are aquired by the scrper. Also need to pass Results struct here for rendering.

func RenderSetupModelView

func RenderSetupModelView() error

Function Call to Render SetupModel

func SetMagnetChoice

func SetMagnetChoice(magnet string)

func SetPlayerChoice

func SetPlayerChoice(choice string)

func StartStream

func StartStream() error

Types

type ListModel

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

func NewListModel

func NewListModel(title string, results scraper.Results) ListModel

title argument will be used later once tv-series is implemented.

func (ListModel) Init

func (m ListModel) Init() tea.Cmd

func (ListModel) Update

func (m ListModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ListModel) View

func (m ListModel) View() string

type SetupModel

type SetupModel struct {
	PlayerChoice string
	Choice       int
	Chosen       bool
	Quitting     bool
}

func (SetupModel) Init

func (m SetupModel) Init() tea.Cmd

func (SetupModel) Update

func (m SetupModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Main Update Function for SetupModel

func (SetupModel) View

func (m SetupModel) View() string

The main view, which just calls the appropriate sub-view

Jump to

Keyboard shortcuts

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