components

package
v0.0.0-...-8ab52e7 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Head = iota
	Tail
	Folder
	Req
)
View Source
const (
	Typing state = iota
	Focus
	Blur
	Close
	Open
)

Variables

View Source
var SelectedItemsStyle lipgloss.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("201"))

Functions

This section is empty.

Types

type HttpRequestCmd

type HttpRequestCmd struct{}

type Items

type Items struct {
	Name     string
	Typ      int
	Children []*Items
	Prev     *Items
	Next     *Items
	Parent   *Items
	Selected bool
}

func MakeItems

func MakeItems(name string, typ int) Items

func NewItems

func NewItems(name string, typ int) *Items

func (*Items) Add

func (p *Items) Add(parent, n *Items) (next *Items)

func (*Items) Init

func (m *Items) Init() tea.Cmd

func (*Items) Last

func (i *Items) Last() *Items

func (Items) PrintHead

func (i Items) PrintHead() string

func (Items) PrintTail

func (i Items) PrintTail() string

func (Items) PrintTree

func (i Items) PrintTree(d int) string

func (*Items) SelectNext

func (i *Items) SelectNext()

func (*Items) SelectPrev

func (i *Items) SelectPrev()

func (*Items) Update

func (m *Items) Update(msg tea.Msg) tea.Cmd

type MainModel

type MainModel struct {
	Viewport viewport.Model
	Ready    bool

	SideBarState state
	Style        lipgloss.Style
	// contains filtered or unexported fields
}

func InitialModel

func InitialModel() MainModel

func (MainModel) HandleFocus

func (m MainModel) HandleFocus() (MainModel, tea.Cmd)

func (*MainModel) HttpRequest

func (m *MainModel) HttpRequest()

func (MainModel) Init

func (m MainModel) Init() tea.Cmd

func (MainModel) InitComponent

func (m MainModel) InitComponent(size tea.WindowSizeMsg) MainModel

func (MainModel) Update

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

func (*MainModel) UpdateAll

func (m *MainModel) UpdateAll(msg tea.Msg) tea.Cmd

func (MainModel) View

func (m MainModel) View() string

type ResponseBody

type ResponseBody struct {
	Viewport viewport.Model
	State    state
	Parent   tea.Model
	Style    lipgloss.Style
}

func MakeResponseBody

func MakeResponseBody(body string, size tea.WindowSizeMsg, updateSize UpdateSize) ResponseBody

func (ResponseBody) Init

func (m ResponseBody) Init() tea.Cmd

func (ResponseBody) Update

func (m ResponseBody) Update(msg tea.Msg) (ResponseBody, tea.Cmd)

func (ResponseBody) View

func (m ResponseBody) View() string
type SideBar struct {
	Viewport viewport.Model
	Style    lipgloss.Style
	State    state
	Head     Items
	Tail     Items
}

func MakeSideBar

func MakeSideBar(size tea.WindowSizeMsg, updateSize UpdateSize) SideBar

func (SideBar) Init

func (m SideBar) Init() tea.Cmd

func (SideBar) Update

func (m SideBar) Update(msg tea.Msg) (SideBar, tea.Cmd)

func (SideBar) View

func (m SideBar) View() string

type TextBody

type TextBody struct {
	Body     textinput.Model
	Viewport viewport.Model
	State    state
	Parent   tea.Model
	Style    lipgloss.Style
}

func MakeTextBody

func MakeTextBody(body string, size tea.WindowSizeMsg, updateSize UpdateSize) TextBody

func (TextBody) Init

func (m TextBody) Init() tea.Cmd

func (TextBody) Update

func (m TextBody) Update(msg tea.Msg) (TextBody, tea.Cmd)

func (TextBody) View

func (m TextBody) View() string

type UpdateFocus

type UpdateFocus struct {
	Name string
}

type UpdateSize

type UpdateSize tea.WindowSizeMsg

type Urlbar

type Urlbar struct {
	Url      textinput.Model
	Viewport viewport.Model
	Title    string
	State    state
	Parent   tea.Model
	Style    lipgloss.Style
}

func MakeUrlbar

func MakeUrlbar(url string, title string, size tea.WindowSizeMsg, updateSize UpdateSize) Urlbar

func (Urlbar) Init

func (m Urlbar) Init() tea.Cmd

func (Urlbar) Update

func (m Urlbar) Update(msg tea.Msg) (Urlbar, tea.Cmd)

func (Urlbar) View

func (m Urlbar) View() string

Jump to

Keyboard shortcuts

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