Documentation ¶
Index ¶
- Constants
- Variables
- func BuildStars(data [][2]int64, maxStars int, starChar string) string
- func CenterText(str string, width int) string
- func ColorFor(label string) tcell.Color
- func Exclude(strs []string, val string) bool
- func ExecuteCommand(cmd *exec.Cmd) string
- func ExpandHomeDir(path string) (string, error)
- func FindMatch(pattern string, data string) [][]string
- func Home() (string, error)
- func IsToday(date time.Time) bool
- func NameFromEmail(email string) string
- func NamesFromEmails(emails []string) []string
- func NewBillboardModal(text string, closeFunc func()) *tview.Frame
- func Now() time.Time
- func OpenFile(path string)
- func PadRow(offset int, max int) string
- func PrettyDate(dateStr string) string
- func ReadFileBytes(filePath string) ([]byte, error)
- func RightAlignFormat(view *tview.TextView) string
- func RowColor(module string, idx int) string
- func Schedule(widget Wtfable)
- func SigilStr(len, pos int, view *tview.TextView) string
- func ToInts(slice []interface{}) []int
- func ToStrs(slice []interface{}) []string
- func Tomorrow() time.Time
- func UnixTime(unix int64) time.Time
- type BarGraph
- func (widget *BarGraph) BorderColor() string
- func (widget *BarGraph) BuildBars(data [][2]int64)
- func (widget *BarGraph) Disable()
- func (widget *BarGraph) Disabled() bool
- func (widget *BarGraph) Enabled() bool
- func (widget *BarGraph) Focusable() bool
- func (widget *BarGraph) RefreshInterval() int
- func (widget *BarGraph) TextView() *tview.TextView
- func (widget *BarGraph) UpdateRefreshedAt()
- type Display
- type Enabler
- type FocusState
- type FocusTracker
- type Position
- type Scheduler
- type TextWidget
- func (widget *TextWidget) BorderColor() string
- func (widget *TextWidget) Disable()
- func (widget *TextWidget) Disabled() bool
- func (widget *TextWidget) Enabled() bool
- func (widget *TextWidget) Focusable() bool
- func (widget *TextWidget) RefreshInterval() int
- func (widget *TextWidget) TextView() *tview.TextView
- func (widget *TextWidget) UpdateRefreshedAt()
- type Wtfable
Constants ¶
const DateFormat = "2006-01-02"
DateFormat defines the format we expect to receive dates from BambooHR in
const FriendlyDateFormat = "Mon, Jan 2"
const FriendlyDateTimeFormat = "Mon, Jan 2, 15:04"
const SimpleDateFormat = "Jan 2"
const SimpleTimeFormat = "15:04 MST"
const TimeFormat = "15:04"
const TimestampFormat = "2006-01-02T15:04:05-0700"
Variables ¶
var Config *config.Config
Functions ¶
func BuildStars ¶ added in v0.0.10
BuildStars build the string to display
func CenterText ¶
func ExecuteCommand ¶
func ExpandHomeDir ¶
Expand expands the path to include the home directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is.
func Home ¶
Dir returns the home directory for the executing user. An error is returned if a home directory cannot be detected.
func NameFromEmail ¶
func NamesFromEmails ¶
func NewBillboardModal ¶
func OpenFile ¶
func OpenFile(path string)
OpenFile opens the file defined in `path` via the operating system
func PadRow ¶
PadRow returns a padding for a row to make it the full width of the containing widget. Useful for ensurig row highlighting spans the full width (I suspect tcell has a better way to do this, but I haven't yet found it)
func PrettyDate ¶
func ReadFileBytes ¶
func RightAlignFormat ¶
Types ¶
type BarGraph ¶ added in v0.0.7
type BarGraph struct { Name string RefreshedAt time.Time RefreshInt int View *tview.TextView Position Data [][2]int64 // contains filtered or unexported fields }
BarGraph lets make graphs
func NewBarGraph ¶ added in v0.0.7
NewBarGraph initialize your fancy new graph
func (*BarGraph) BorderColor ¶ added in v0.0.7
func (*BarGraph) BuildBars ¶ added in v0.0.7
BuildBars will build a string of * to represent your data of time[value] time should be passed as a int64
func (*BarGraph) RefreshInterval ¶ added in v0.0.7
func (*BarGraph) UpdateRefreshedAt ¶ added in v0.0.7
func (widget *BarGraph) UpdateRefreshedAt()
type Display ¶ added in v0.0.9
func NewDisplay ¶ added in v0.0.9
type FocusTracker ¶
type FocusTracker struct { App *tview.Application Idx int Widgets []Wtfable }
FocusTracker is used by the app to track which onscreen widget currently has focus, and to move focus between widgets.
func (*FocusTracker) Next ¶
func (tracker *FocusTracker) Next()
Next sets the focus on the next widget in the widget list. If the current widget is the last widget, sets focus on the first widget.
func (*FocusTracker) None ¶
func (tracker *FocusTracker) None()
None removes focus from the currently-focused widget.
func (*FocusTracker) Prev ¶
func (tracker *FocusTracker) Prev()
Prev sets the focus on the previous widget in the widget list. If the current widget is the last widget, sets focus on the last widget.
func (*FocusTracker) Refocus ¶
func (tracker *FocusTracker) Refocus()
type Position ¶
type Position struct {
// contains filtered or unexported fields
}
func NewPosition ¶ added in v0.0.3
type TextWidget ¶
type TextWidget struct { Name string RefreshedAt time.Time RefreshInt int View *tview.TextView Position // contains filtered or unexported fields }
func NewTextWidget ¶
func NewTextWidget(name string, configKey string, focusable bool) TextWidget
func (*TextWidget) BorderColor ¶
func (widget *TextWidget) BorderColor() string
func (*TextWidget) Disable ¶ added in v0.0.7
func (widget *TextWidget) Disable()
func (*TextWidget) Disabled ¶
func (widget *TextWidget) Disabled() bool
func (*TextWidget) Enabled ¶
func (widget *TextWidget) Enabled() bool
func (*TextWidget) Focusable ¶
func (widget *TextWidget) Focusable() bool
func (*TextWidget) RefreshInterval ¶
func (widget *TextWidget) RefreshInterval() int
func (*TextWidget) TextView ¶
func (widget *TextWidget) TextView() *tview.TextView
func (*TextWidget) UpdateRefreshedAt ¶ added in v0.0.3
func (widget *TextWidget) UpdateRefreshedAt()