views

package
v0.0.0-...-690d975 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package views implements different types of views that are used by the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	*Client
	// contains filtered or unexported fields
}

Base represents the base view.

func NewBase

func NewBase(app *tview.Application, config config.Config) *Base

NewBase returns an instance of the base with new client.

type Client

type Client struct {
	GqlClient *githubv4.Client

	*github.Client
	context.Context
}

Client represents the github client.

func NewClient

func NewClient(config config.Config) *Client

NewClient returns a new client with the provided token.

type PinnedItem

type PinnedItem struct {
	*tview.Box
	*PinnedItemContent
}

PinnedItem represents a pinned github item.

func NewPinnedItem

func NewPinnedItem() *PinnedItem

NewPinnedItem returns an instance of pinned item with borders.

func (*PinnedItem) SetContent

func (p *PinnedItem) SetContent(content *PinnedItemContent) *PinnedItem

SetContent sets the content of the pinned item.

type PinnedItemContent

type PinnedItemContent struct {
	Name        string
	Description string
	Lang        string
	Stars       string
	Archived    string
}

PinnedItemContent represents the pinned item details.

type PinnedView

type PinnedView struct {
	*tview.Box
	// contains filtered or unexported fields
}

PinnedView is box which displays the pinned items within their respective box primitives.

func NewPinnedView

func NewPinnedView() *PinnedView

NewPinnedView returns a new pinned view.

func (*PinnedView) Clear

func (p *PinnedView) Clear()

Clear removes all the pinned items from the pinned view.

func (*PinnedView) Draw

func (p *PinnedView) Draw(screen tcell.Screen)

Draw draws the primitive onto the screen.

func (*PinnedView) SetItems

func (p *PinnedView) SetItems(items []*PinnedItem)

SetItems sets the pinned items that can be rendered within the pinned view.

type TextWidget

type TextWidget struct {
	*Base
	*tview.TextView
}

TextWidget represents a text widget used by the application.

func NewTextView

func NewTextView(app *tview.Application, config config.Config, bordered bool) *TextWidget

NewTextView returns a new text widget with the provided options.

func (*TextWidget) Redraw

func (t *TextWidget) Redraw(display func())

Redraw refreshes the text widget.

Jump to

Keyboard shortcuts

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