dashboard

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDashboard

func NewDashboard(appVersion string, configSchemaVersion string, configPath string) (err error)

NewDashboard constructs a new Dashboard

Types

type ByPath added in v0.9.4

type ByPath struct {
	StatusItems
}

ByPath is a struct for sorting StatusItems

func (ByPath) Less added in v0.9.4

func (b ByPath) Less(i, j int) bool

Less is interface method of sort

type ByStage added in v0.9.4

type ByStage struct {
	StatusItems
}

ByStage is a struct for sorting StatusItems

func (ByStage) Less added in v0.9.4

func (s ByStage) Less(i, j int) bool

Less is interface method of sort

type Col

type Col struct {
	Section string
	Widgets []Widget
}

Col is the schema implements Config.Widgets.Section

type Config

type Config struct {
	SchemaVersion string `yaml:"schema_version"`
	Timezone      string
	GitHubHost    string `yaml:"github_url"`
	Envs          []map[string]string
	Rows          []Row
}

Config is the root schema of config file

type ConfigManager

type ConfigManager struct {
	LoadedData *Config
}

ConfigManager load and unmarshal config file

func NewConfigManager

func NewConfigManager(path string) (c *ConfigManager, err error)

NewConfigManager constructs a ConfigManager

type Dashboard

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

Dashboard controls termui's widget layout and keybindings

type GitStatusWidget added in v0.9.4

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

GitStatusWidget is a command launcher

func NewGitStatusWidget added in v0.9.4

func NewGitStatusWidget(wi Widget, execPath string, envs []map[string]string) (g *GitStatusWidget, err error)

NewGitStatusWidget constructs a New GitStatusWidget

func (*GitStatusWidget) Activate added in v0.9.4

func (g *GitStatusWidget) Activate()

Activate is the implementation of Widget.Activate

func (*GitStatusWidget) Deactivate added in v0.9.4

func (g *GitStatusWidget) Deactivate()

Deactivate is the implementation of Widget.Activate

func (*GitStatusWidget) GetHighlightenPos added in v0.9.4

func (g *GitStatusWidget) GetHighlightenPos() int

GetHighlightenPos is the implementation of Widget.GetHighlightenPos

func (*GitStatusWidget) GetWidget added in v0.9.4

func (g *GitStatusWidget) GetWidget() *ui.List

GetWidget is the implementation of widget.Activate

func (*GitStatusWidget) IsDisabled added in v0.9.4

func (g *GitStatusWidget) IsDisabled() bool

IsDisabled is the implementation of Widget.IsDisabled

func (*GitStatusWidget) IsReady added in v0.9.4

func (g *GitStatusWidget) IsReady() bool

IsReady is the implementation of Widget.IsReady

type GithubIssueWidget

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

GithubIssueWidget is a widget which shows a issue of the current branch referering its name including issue id

func NewGithubIssueWidget

func NewGithubIssueWidget(wi Widget, timezone string) (g *GithubIssueWidget, err error)

NewGithubIssueWidget constructs a New GithubIssueWidget

func (*GithubIssueWidget) Activate

func (g *GithubIssueWidget) Activate()

Activate is the implementation of Widget.Activate

func (*GithubIssueWidget) Deactivate

func (g *GithubIssueWidget) Deactivate()

Deactivate is the implementation of Widget.Deactivate

func (*GithubIssueWidget) Disable

func (g *GithubIssueWidget) Disable()

Disable sets a GithubIssueWidget instance as disabled

func (*GithubIssueWidget) GetHighlightenPos

func (g *GithubIssueWidget) GetHighlightenPos() int

GetHighlightenPos is the implementation of Widget.GetHighlightenPos

func (*GithubIssueWidget) GetWidget

func (g *GithubIssueWidget) GetWidget() *ui.List

GetWidget is the implementation of Widget.Activate

func (*GithubIssueWidget) IsDisabled

func (g *GithubIssueWidget) IsDisabled() bool

IsDisabled is the implementation of Widget.IsDisabled

func (*GithubIssueWidget) IsReady

func (g *GithubIssueWidget) IsReady() bool

IsReady is the implementation of Widget.IsReady

func (*GithubIssueWidget) Render

func (g *GithubIssueWidget) Render(client *github.Client) (err error)

Render renders the issue contents

type ListRenderer

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

ListRenderer make a List widget which includes multi-line texts look like scrolled

func NewListRenderer

func NewListRenderer(opt *ListRendererOption) (l *ListRenderer)

NewListRenderer constructs a ListWrapper

func (*ListRenderer) AddBody added in v0.9.4

func (l *ListRenderer) AddBody(line string)

AddBody add an another line of text to ListWrapper.body

func (*ListRenderer) GetCursor

func (l *ListRenderer) GetCursor() int

GetCursor returns ListWrapper.cursor

func (*ListRenderer) MoveCursor added in v0.9.4

func (l *ListRenderer) MoveCursor(direction string) (items []string)

MoveCursor moves cursor position to "direction" with no focuse

func (*ListRenderer) MoveCursorWithFocus added in v0.9.4

func (l *ListRenderer) MoveCursorWithFocus(direction string) (items []string)

MoveCursorWithFocus moves cursor position to "direction" with a highlightened focus

func (*ListRenderer) RenderActually

func (l *ListRenderer) RenderActually() []string

RenderActually renders list

func (*ListRenderer) ResetRender

func (l *ListRenderer) ResetRender() (items []string)

ResetRender returns a initial multi-line texts

func (*ListRenderer) SetBody

func (l *ListRenderer) SetBody(items []string)

SetBody replace strings on ListWrapper.body

type ListRendererOption

type ListRendererOption struct {
	MaxH          int
	Header        []string
	Body          []string
	LineHighLight bool
}

ListRendererOption is the option argument for NewListWrapper

type ListWrapper

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

ListWrapper make a List widget which includes multi-line texts look like scrolled

func NewListWrapper

func NewListWrapper(opt *ListWrapperOption) (l *ListWrapper)

NewListWrapper constructs a ListWrapper

func (*ListWrapper) AddBody added in v0.9.4

func (l *ListWrapper) AddBody(line string)

AddBody add an another line of textto ListWrapper.body

func (*ListWrapper) GetCursor

func (l *ListWrapper) GetCursor() int

GetCursor returns ListWrapper.cursor

func (*ListWrapper) GetWidget

func (l *ListWrapper) GetWidget() *ui.List

GetWidget returns the instance of ui.List

func (*ListWrapper) MmoveCursorWithFocus added in v0.9.4

func (l *ListWrapper) MmoveCursorWithFocus(direction string)

MmoveCursorWithFocus moves cursor and update ui

func (*ListWrapper) MoveCursor added in v0.9.4

func (l *ListWrapper) MoveCursor(direction string)

MoveCursor moves cursor

func (*ListWrapper) Render

func (l *ListWrapper) Render()

Render display current *ui.List.Items

func (*ListWrapper) ResetRender

func (l *ListWrapper) ResetRender()

ResetRender returns a initial multi-line texts

func (*ListWrapper) SetBody

func (l *ListWrapper) SetBody(items []string)

SetBody replace strings on ListWrapper.body

type ListWrapperOption

type ListWrapperOption struct {
	Title         string
	RealHeight    int
	Header        []string
	Body          []string
	LineHighLight bool
}

ListWrapperOption is the option argument for NewListWrapper

type Menu struct {
	Category    string
	Name        string
	Description string
	Command     string
}

Menu is the schema implements Config.Widgets.Menu

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

MenuWidget is a command launcher

func NewMenuWidget

func NewMenuWidget(wi Widget, envs []map[string]string) (m *MenuWidget, err error)

NewMenuWidget constructs a New MenuWidget

func (m *MenuWidget) Activate()

Activate is the implementation of Widget.Activate

func (m *MenuWidget) Deactivate()

Deactivate is the implementation of Widget.Activate

func (m *MenuWidget) GetHighlightenPos() int

GetHighlightenPos is the implementation of Widget.GetHighlightenPos

func (m *MenuWidget) GetWidget() *ui.List

GetWidget is the implementation of widget.Activate

func (m *MenuWidget) IsDisabled() bool

IsDisabled is the implementation of Widget.IsDisabled

func (m *MenuWidget) IsReady() bool

IsReady is the implementation of Widget.IsReady

type NoteWidget

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

NoteWidget is a command launcher

func NewNoteWidget

func NewNoteWidget(wi Widget, execPath string) (n *NoteWidget, err error)

NewNoteWidget constructs a New NoteWidget

func (*NoteWidget) Activate

func (n *NoteWidget) Activate()

Activate is the implementation of Widget.Activate

func (*NoteWidget) Deactivate

func (n *NoteWidget) Deactivate()

Deactivate is the implementation of Widget.Activate

func (*NoteWidget) GetHighlightenPos

func (n *NoteWidget) GetHighlightenPos() int

GetHighlightenPos is the implementation of Widget.GetHighlightenPos

func (*NoteWidget) GetWidget

func (n *NoteWidget) GetWidget() *ui.List

GetWidget is the implementation of widget.Activate

func (*NoteWidget) IsDisabled

func (n *NoteWidget) IsDisabled() bool

IsDisabled is the implementation of Widget.IsDisabled

func (*NoteWidget) IsReady

func (n *NoteWidget) IsReady() bool

IsReady is the implementation of Widget.IsReady

type Row

type Row struct {
	Section string
	Height  string // percent
	Cols    []Col
}

Row is the schema implements Config.Widgets.Section

type StatusItem added in v0.9.4

type StatusItem struct {
	Staged   bool
	StatusNo int
	Stage    string
	Status   string
	Path     string
}

StatusItem is a struct which stores each file status of git status

type StatusItems added in v0.9.4

type StatusItems []StatusItem

StatusItems is a collection of StatusItem, and implements sorting

func (StatusItems) Len added in v0.9.4

func (s StatusItems) Len() int

Len is interface method of sort

func (StatusItems) Swap added in v0.9.4

func (s StatusItems) Swap(i, j int)

Swap is interface method of sort

type TailFileWidget added in v0.9.4

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

TailFileWidget is a command launcher

func NewTailFileWidget added in v0.9.4

func NewTailFileWidget(wi Widget, execPath string) (n *TailFileWidget, err error)

NewTailFileWidget constructs a New TailFileWidget

func (*TailFileWidget) Activate added in v0.9.4

func (n *TailFileWidget) Activate()

Activate is the implementation of Widget.Activate

func (*TailFileWidget) Deactivate added in v0.9.4

func (n *TailFileWidget) Deactivate()

Deactivate is the implementation of Widget.Activate

func (*TailFileWidget) GetHighlightenPos added in v0.9.4

func (n *TailFileWidget) GetHighlightenPos() int

GetHighlightenPos is the implementation of Widget.GetHighlightenPos

func (*TailFileWidget) GetWidget added in v0.9.4

func (n *TailFileWidget) GetWidget() *ui.List

GetWidget is the implementation of widget.Activate

func (*TailFileWidget) IsDisabled added in v0.9.4

func (n *TailFileWidget) IsDisabled() bool

IsDisabled is the implementation of Widget.IsDisabled

func (*TailFileWidget) IsReady added in v0.9.4

func (n *TailFileWidget) IsReady() bool

IsReady is the implementation of Widget.IsReady

type Widget

type Widget struct {
	Title      string
	Col        int
	Height     string // percent
	RealHeight int
	Type       string
	IssueRegex string `yaml:"issue_regex"`
	Content    interface{}
	Path       string
}

Widget is the schema implements Config.Widgets

type WidgetItem

type WidgetItem interface {
	Activate()
	Deactivate()
	IsDisabled() bool
	IsReady() bool
	GetWidget() *ui.List
	GetHighlightenPos() int
}

WidgetItem define common interface for each widgets

Jump to

Keyboard shortcuts

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