internal

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

This package is an abstraction of the Terminal UI itself.

Index

Constants

View Source
const FeedlySubscribers = "feedly.box_subscribers"

Variables

This section is empty.

Functions

func Blog added in v0.5.0

func Blog() string

func CreateBlogConfig added in v0.5.0

func CreateBlogConfig(keyfile string, viewID string, address string) blogConfig

func CreateGitHubProjectConfig added in v0.5.0

func CreateGitHubProjectConfig(token string, owner string, repo string) githubConfig

func DisplayError

func DisplayError(tui *Tui, err error) func() error

func ExtractDimensions

func ExtractDimensions(widgetOptions map[string]string) (dimensions []string)

func ExtractMetric

func ExtractMetric(widgetOptions map[string]string) (metric string)

func ExtractTimeRange

func ExtractTimeRange(base time.Time, widgetOptions map[string]string) (sd time.Time, ed time.Time, err error)

func GitHubProject added in v0.5.0

func GitHubProject() string

func MapSize

func MapSize(size string) (int, error)

Map the size of each column if t-shirt size is provided (XXS to XL). Otherwise use the numerical value provided in the config directly.

func NewDisplayWidget

func NewDisplayWidget() *displayWidget

func NewFeedlyWidget

func NewFeedlyWidget(address string) *feedlyWidget

NewFeedlyWidget with all information necessary to connect to the Feedly API.

func NewGaWidget

func NewGaWidget(keyfile string, viewID string) (*gaWidget, error)

NewGaWidget including all information to connect to the Google Analytics API.

func NewGitWidget

func NewGitWidget(path string) *gitWidget

func NewGithubWidget

func NewGithubWidget(token string, owner string, repo string) (*githubWidget, error)

NewGithubWidget with all information necessary to connect to the Github API.

func NewGscWidget

func NewGscWidget(keyfile string, address string) (*gscWidget, error)

NewGscWidget including everything to connect to the Google Search Console API.

func NewMonitorWidget

func NewMonitorWidget(address string) (*monitorWidget, error)

NewMonitorWidget with the address of the website to monitor.

func NewProject

func NewProject(
	name string,
	nameOptions map[string]string,
	widgets [][][]Widget,
	sizes [][]string,
	themes map[string]map[string]string,
	tui *Tui,
) *project

NewProject for the dashboard.

func NewTravisCIWidget

func NewTravisCIWidget(token string) *travisCIWidget

NewTravisCIWidget with all information necessary to connect to the Github API.

Types

type HostWidget

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

func NewHostWidget

func NewHostWidget(username, addr string) (*HostWidget, error)

func (*HostWidget) CreateWidgets

func (ms *HostWidget) CreateWidgets(widget Widget, tui *Tui) (f func() error, err error)

type Tui

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

func NewTUI

func NewTUI(instance manager) *Tui

func (*Tui) AddBarChart

func (t *Tui) AddBarChart(
	data []int,
	dimensions []string,
	title string,
	options map[string]string,
) (err error)

AddBarChart to the TUI, a representation of the evolution of a dataset overtime.

func (*Tui) AddCol

func (t *Tui) AddCol(size string) error

AddCol to the TUI grid.

func (*Tui) AddGauge

func (t *Tui) AddGauge(
	data float64,
	title string,
	options map[string]string,
) (err error)

func (*Tui) AddKEdit added in v0.5.0

func (t *Tui) AddKEdit(
	key string,
	editDashboard func(),
)

func (*Tui) AddKHotReload

func (t *Tui) AddKHotReload(key string, c chan<- time.Time)

func (*Tui) AddKQuit

func (t *Tui) AddKQuit(key string)

Add keyboard shortcut from the config to quit DevDash. Default Control C.

func (*Tui) AddProjectTitle

func (t *Tui) AddProjectTitle(title string, options map[string]string) (err error)

AddProjectTitle to the TUI.

func (*Tui) AddRow

func (t *Tui) AddRow()

AddRow to the TUI grid.

func (*Tui) AddStackedBarChart

func (t *Tui) AddStackedBarChart(
	data [8][]int,
	dimensions []string,
	title string,
	colors []uint16,
	options map[string]string,
) (err error)

AddStackedBarChart to the TUI, which represent two or more dataset overtime.

func (*Tui) AddTable

func (t *Tui) AddTable(data [][]string, title string, options map[string]string) error

AddTable to the TUI, with a header and the dataset.

func (*Tui) AddTextBox

func (t *Tui) AddTextBox(
	data string,
	title string,
	options map[string]string,
) (err error)

AddTextBox to the TUI.

func (*Tui) Align added in v0.5.0

func (t *Tui) Align()

func (*Tui) Clean

func (t *Tui) Clean()

Clean and reinitialize the TUI.

func (*Tui) Close

func (t *Tui) Close()

Close the TUI.

func (*Tui) HotReload

func (t *Tui) HotReload()

Hot reload the whole TUI

func (*Tui) Loop

func (t *Tui) Loop()

Loop the TUI to receive events.

func (*Tui) Render

func (t *Tui) Render()

Render the TUI.

type Widget

type Widget struct {
	Name    string            `mapstructures:"name"`
	Size    string            `mapstructures:"size"`
	Options map[string]string `mapstructures:"options"`
	Theme   string            `mapstructures:"theme"`
}

A widget is a representation of a set of data in the screen.

Directories

Path Synopsis
Google Search Console
Google Search Console

Jump to

Keyboard shortcuts

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