Documentation
¶
Index ¶
- Variables
- func GenerateBarChart(ctx context.Context, percent float64, size int, barType string) string
- type Box
- func (b *Box) ConstructLine(ctx context.Context, stat wakatime.StatItem) string
- func (b *Box) GenerateGistLines(ctx context.Context, languages []wakatime.StatItem) ([]string, error)
- func (b *Box) GetGist(ctx context.Context, id string) (*github.Gist, error)
- func (b *Box) GetStats(ctx context.Context) ([]string, error)
- func (b *Box) UpdateGist(ctx context.Context, id string, gist *github.Gist) error
- func (b *Box) UpdateMarkdown(ctx context.Context, title, filename string, content []byte) error
- type BoxStyle
Constants ¶
This section is empty.
Variables ¶
var BarStyle = map[string][]rune{ "SOLIDLT": []rune(`░▏▎▍▌▋▊▉█`), "SOLIDMD": []rune(`▒▏▎▍▌▋▊▉█`), "SOLIDDK": []rune(`▓▏▎▍▌▋▊▉█`), "EMPTY": []rune(` ▏▎▍▌▋▊▉█`), "UNDERSCORE": []rune(`▁▏▎▍▌▋▊▉█`), }
BarStyle defines valid styles for the progress bar
Functions ¶
func GenerateBarChart ¶
GenerateBarChart generates a bar chart with the given percent and size. Percent is a float64 from 0-100 representing the progress bar percentage Size is an int representing the length of the progress bar in characters BarType is a BarType representing the type of barchart: It can be one of the following:
SOLIDLT SOLIDMD SOLIDDK: Block characters with a dotted background UNDERSCORE: Block characters with an line accross the boottom EMPTY: Block characters with an empty background
Types ¶
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box contains a github and wakatime client and styling information for the gist box
func NewBox ¶
NewBox creates a box struct with appropriate wakatime and github information and gist styling information
func (*Box) ConstructLine ¶
ConstructLine formats a gist line from stat infomation
func (*Box) GenerateGistLines ¶
func (b *Box) GenerateGistLines(ctx context.Context, languages []wakatime.StatItem) ([]string, error)
GenerateGistLines takes an slice of wakatime.StatItems, and generates a line for the gist.
func (*Box) UpdateGist ¶
UpdateGist updates the gist.
type BoxStyle ¶
type BoxStyle struct { BarStyle string // Style of the progress bar as defined by BarStyle BarLength string // Length of the bar as a string (gets converted to an Int) TimeStyle string // Style of the time text. "SHORT" will be abbreviated. // contains filtered or unexported fields }
BoxStyle contains information for initalizing a gist box style