Documentation
¶
Index ¶
- type Color
- func (c *Color) Configure(oc *config.OutputConfig)
- func (c *Color) Error(s string)
- func (c *Color) Event(event *model.Event)
- func (c *Color) Fatal(s string)
- func (c *Color) Info(s string)
- func (c *Color) Inline(s string)
- func (c *Color) Star(star *model.Star)
- func (c *Color) StarLine(star *model.Star)
- func (c *Color) Tag(tag *model.Tag)
- func (c *Color) Tick()
- type Output
- type Text
- func (t *Text) Configure(oc *config.OutputConfig)
- func (t *Text) Error(s string)
- func (t *Text) Event(event *model.Event)
- func (t *Text) Fatal(s string)
- func (t *Text) Info(s string)
- func (t *Text) Inline(s string)
- func (t *Text) Star(star *model.Star)
- func (t *Text) StarLine(star *model.Star)
- func (t *Text) Tag(tag *model.Tag)
- func (t *Text) Tick()
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color struct {
}
Color is a color text output
func (*Color) Configure ¶ added in v0.5.0
func (c *Color) Configure(oc *config.OutputConfig)
Configure configures the output
type Output ¶
type Output interface {
Configure(*config.OutputConfig)
Inline(string)
Info(string)
Event(*model.Event)
Error(string)
Fatal(string)
StarLine(*model.Star)
Star(*model.Star)
Tag(*model.Tag)
Tick()
}
Output represents an output option
type Text ¶
type Text struct {
}
Text is a monochrome text output
func (*Text) Configure ¶ added in v0.5.0
func (t *Text) Configure(oc *config.OutputConfig)
Configure no-ops
func (*Text) Info ¶
Info displays information
Example ¶
text.Info("This is info")
Output: This is info
func (*Text) Inline ¶ added in v0.2.0
Inline displays text in line
Example ¶
text.Inline("This is inline")
Output: This is inline
func (*Text) Star ¶
Star displays a star
Example ¶
fullName := "hoop33/limo"
language := "Go"
description := "A CLI for managing starred Git repositories"
homepage := "https://github.com/hoop33/limo"
url := "https://github.com/hoop33/limo.git"
star := &model.Star{
FullName: &fullName,
Stargazers: 1000000,
Language: &language,
Description: &description,
Homepage: &homepage,
URL: &url,
StarredAt: time.Date(2016, time.June, 21, 14, 56, 5, 0, time.UTC),
Tags: []model.Tag{
{
Name: "cli",
},
{
Name: "git",
},
},
}
text.Star(star)
Output: hoop33/limo *:1000000 Go https://github.com/hoop33/limo.git cli, git A CLI for managing starred Git repositories Home page: https://github.com/hoop33/limo Starred on Tue Jun 21 14:56:05 UTC 2016
Click to show internal directories.
Click to hide internal directories.