tui

package
v0.0.0-...-e36c38d Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectHome

func SelectHome() tea.Cmd

func SelectPost

func SelectPost(postid string) tea.Cmd

func SelectSubreddit

func SelectSubreddit(name string) tea.Cmd

func ShowError

func ShowError(err string) tea.Cmd

Types

type Error

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

func (Error) Init

func (e Error) Init() tea.Cmd

func (Error) Update

func (e Error) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Error) View

func (e Error) View() string

type ErrorMsg

type ErrorMsg struct {
	Error string
}

type Home

type Home struct {
	Posts []*reddit.Post
	// contains filtered or unexported fields
}

func NewHome

func NewHome(client *reddit.SubredditService, styles *style.Styles) *Home

func (Home) Init

func (home Home) Init() tea.Cmd

func (Home) Update

func (home Home) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Home) View

func (home Home) View() string

type Post

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

func NewPost

func NewPost(client *reddit.PostService, styles *style.Styles) *Post

func (Post) Build

func (p Post) Build() string

func (Post) BuildCommentSection

func (p Post) BuildCommentSection(comment *reddit.Comment, indent int) []string

func (Post) Init

func (p Post) Init() tea.Cmd

func (Post) Update

func (p Post) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Post) View

func (p Post) View() string

type PostItem

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

func (PostItem) Description

func (i PostItem) Description() string

func (PostItem) FilterValue

func (i PostItem) FilterValue() string

func (PostItem) Title

func (i PostItem) Title() string

type SelectHomeMsg

type SelectHomeMsg struct {
	Name string
}

type SelectPostMsg

type SelectPostMsg struct {
	Id string
}

type SelectSubredditMsg

type SelectSubredditMsg struct {
	Name string
}

type SessionState

type SessionState int

type Window

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

func NewWindow

func NewWindow() *Window

func (Window) Init

func (w Window) Init() tea.Cmd

func (Window) Update

func (w Window) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Window) View

func (w Window) View() string

Jump to

Keyboard shortcuts

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