Documentation
¶
Overview ¶
This package is an abstraction of the Terminal UI itself.
Index ¶
- Constants
- func AllOptions() []string
- func Blog() string
- func CreateBlogConfig(keyfile string, address string, propertyID string) blogConfig
- func CreateGitHubProjectConfig(token string, owner string, repo string) githubConfig
- func DisplayError(tui *Tui, err error) func() error
- func ExtractDimensions(widgetOptions map[string]string) (dimensions []string)
- func ExtractMetric(widgetOptions map[string]string) (metric string)
- func ExtractTimeRange(base time.Time, widgetOptions map[string]string) (sd time.Time, ed time.Time, err error)
- func GitHubProject() string
- func MapSize(size string) (int, error)
- func NewDisplayWidget() *displayWidget
- func NewFeedlyWidget(address string) *feedlyWidget
- func NewGaWidget(keyfile string, propertyID string) (*gaWidget, error)
- func NewGitWidget(path string) *gitWidget
- func NewGithubWidget(token string, owner string, repo string) (*githubWidget, error)
- func NewGscWidget(keyfile string, address string) (*gscWidget, error)
- func NewJSONWidget() *jsonWidget
- func NewMonitorWidget(address string) (*monitorWidget, error)
- func NewProject(name string, nameOptions map[string]string, widgets [][][]Widget, ...) *project
- func Schema() ([]byte, error)
- func WidgetNames() []string
- func WidgetOptions(name string) ([]string, bool)
- type HostWidget
- type Problem
- type Tui
- func (t *Tui) AddBarChart(data []int, dimensions []string, title string, options map[string]string) (err error)
- func (t *Tui) AddCol(size string) error
- func (t *Tui) AddGauge(data float64, title string, options map[string]string) (err error)
- func (t *Tui) AddKAction(key string, action func())
- func (t *Tui) AddKEdit(key string, editDashboard func())
- func (t *Tui) AddKHotReload(key string, c chan<- time.Time)
- func (t *Tui) AddKQuit(key string)
- func (t *Tui) AddProjectTitle(title string, options map[string]string) (err error)
- func (t *Tui) AddRow()
- func (t *Tui) AddStackedBarChart(data [8][]int, dimensions []string, title string, colors []uint16, ...) (err error)
- func (t *Tui) AddTable(data [][]string, title string, options map[string]string) error
- func (t *Tui) AddTextBox(data string, title string, options map[string]string) (err error)
- func (t *Tui) Clean()
- func (t *Tui) Close()
- func (t *Tui) HotReload()
- func (t *Tui) Loop()
- func (t *Tui) Render()
- type Widget
Constants ¶
const FeedlySubscribers = "feedly.box_subscribers"
const SchemaURL = "https://raw.githubusercontent.com/PiercingXX/devdash/master/doc/devdash.schema.json"
SchemaURL where the JSON schema of the dashboards is published.
Variables ¶
This section is empty.
Functions ¶
func CreateBlogConfig ¶
func DisplayError ¶
func ExtractDimensions ¶
func ExtractMetric ¶
func ExtractTimeRange ¶
func GitHubProject ¶
func GitHubProject() string
func MapSize ¶
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 ¶
NewGaWidget including all information to connect to the Google Analytics API.
func NewGitWidget ¶
func NewGitWidget(path string) *gitWidget
func NewGithubWidget ¶
NewGithubWidget with all information necessary to connect to the Github API.
func NewGscWidget ¶
NewGscWidget including everything to connect to the Google Search Console API.
func NewJSONWidget ¶
func NewJSONWidget() *jsonWidget
func NewMonitorWidget ¶
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 WidgetNames ¶
func WidgetNames() []string
WidgetNames of every widget, sorted. The host widgets are listed for the local host (lh) and the remote host (rh).
func WidgetOptions ¶
WidgetOptions accepted by a widget: its own options and the display options of its type. False if the widget doesn't exist.
Types ¶
type HostWidget ¶
type HostWidget struct {
// contains filtered or unexported fields
}
func NewHostWidget ¶
func NewHostWidget(username, addr, knownHosts string) (*HostWidget, error)
func (*HostWidget) CreateWidgets ¶
func (ms *HostWidget) CreateWidgets(widget Widget, tui *Tui) (f func() error, err error)
type Problem ¶
Problem found in a dashboard.
func CheckDashboard ¶
CheckDashboard finds the problems of a dashboard, given as its raw configuration.
type Tui ¶
type Tui struct {
// contains filtered or unexported fields
}
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) AddKAction ¶
AddKAction runs an action when the key is pressed.
func (*Tui) AddProjectTitle ¶
AddProjectTitle to the TUI.
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) AddTextBox ¶
AddTextBox to the TUI.