wtf

package
v0.0.0-...-9c5270f Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DateFormat defines the format we expect to receive dates from BambooHR in
	DateFormat = "2006-01-02"

	// TimeFormat defines the format we expect to receive times from BambooHR in
	TimeFormat = "15:04"
)

Variables

This section is empty.

Functions

func ASCIItoTviewColors

func ASCIItoTviewColors(text string) string

func ColorFor

func ColorFor(label string) tcell.Color

func IsToday

func IsToday(date time.Time) bool

IsToday returns TRUE if the date is today, FALSE if the date is not today

func PrettyDate

func PrettyDate(dateStr string) string

PrettyDate takes a programmer-style date string and converts it in a friendlier-to-read format

func Round

func Round(num float64) int

Round rounds a float to an integer

func SetTerminal

func SetTerminal(config *config.Config)

SetTerminal sets the TERM environment variable, defaulting to whatever the OS has as the current value if none is specified. See https://www.gnu.org/software/gettext/manual/html_node/The-TERM-variable.html for more details.

func TruncateFloat64

func TruncateFloat64(num float64, precision int) float64

TruncateFloat64 truncates the decimal places of a float64 to the specified precision

func UnixTime

func UnixTime(unix int64) time.Time

UnixTime takes a Unix epoch time (in seconds) and returns a time.Time instance

Types

type Enablable

type Enablable interface {
	Disable()
	Disabled() bool
	Enabled() bool
}

Enablable is the interface that enforces enable/disable capabilities on a module

type Schedulable

type Schedulable interface {
	Refresh()
	Refreshing() bool
	RefreshInterval() time.Duration
}

Schedulable is the interface that enforces scheduling capabilities on a module

type Stoppable

type Stoppable interface {
	Stop()
}

Stoppable is the interface that enforces a stoppable state

type Wtfable

type Wtfable interface {
	Enablable
	Schedulable
	Stoppable

	BorderColor() string
	ConfigText() string
	FocusChar() string
	Focusable() bool
	HelpText() string
	Name() string
	QuitChan() chan bool
	SetFocusChar(string)
	TextView() *tview.TextView

	CommonSettings() *cfg.Common
}

Wtfable is the interface that enforces WTF system capabilities on a module

Jump to

Keyboard shortcuts

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