output

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

func (*Color) Error

func (c *Color) Error(s string)

Error displays an error

func (*Color) Event added in v0.5.0

func (c *Color) Event(event *model.Event)

Event displays an event {

func (*Color) Fatal

func (c *Color) Fatal(s string)

Fatal displays an error and ends the program

func (*Color) Info

func (c *Color) Info(s string)

Info displays information

func (*Color) Inline added in v0.2.0

func (c *Color) Inline(s string)

Inline displays text in line

func (*Color) Star

func (c *Color) Star(star *model.Star)

Star displays a star

func (*Color) StarLine

func (c *Color) StarLine(star *model.Star)

StarLine displays a star in one line

func (*Color) Tag added in v0.5.0

func (c *Color) Tag(tag *model.Tag)

Tag displays a tag

func (*Color) Tick

func (c *Color) Tick()

Tick displays evidence that the program is working

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

func ForName

func ForName(name string) Output

ForName returns the output for a given name

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) Error

func (t *Text) Error(s string)

Error displays an error

func (*Text) Event added in v0.5.0

func (t *Text) Event(event *model.Event)

Event displays an event {

func (*Text) Fatal

func (t *Text) Fatal(s string)

Fatal displays an error and ends the program

func (*Text) Info

func (t *Text) Info(s string)

Info displays information

Example
text.Info("This is info")
Output:

This is info

func (*Text) Inline added in v0.2.0

func (t *Text) Inline(s string)

Inline displays text in line

Example
text.Inline("This is inline")
Output:

This is inline

func (*Text) Star

func (t *Text) Star(star *model.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

func (*Text) StarLine

func (t *Text) StarLine(star *model.Star)

StarLine displays a star in one line

Example
fullName := "hoop33/limo"
language := "Go"
star := &model.Star{
	FullName:   &fullName,
	Stargazers: 1000000,
	Language:   &language,
}
text.StarLine(star)
Output:

hoop33/limo *:1000000 Go

func (*Text) Tag added in v0.5.0

func (t *Text) Tag(tag *model.Tag)

Tag displays a tag

func (*Text) Tick

func (t *Text) Tick()

Tick displays evidence that the program is working

Example
text.Tick()
Output:

.

Jump to

Keyboard shortcuts

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