dashboard

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: MIT Imports: 21 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 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
	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 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) GetCursor

func (l *ListRenderer) GetCursor() int

GetCursor returns ListWrapper.cursor

func (*ListRenderer) Move

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

Move moves cursor position to "direction"

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) 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) 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) (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) (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 Widget

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

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