output

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2016 License: MIT Imports: 9 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) Error

func (c *Color) Error(s string)

Error displays an error

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

func (c *Color) Tick()

Tick displays evidence that the program is working

type Output

type Output interface {
	Inline(string)
	Info(string)
	Error(string)
	Fatal(string)
	StarLine(*model.Star)
	Star(*model.Star)
	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) Error

func (t *Text) Error(s string)

Error displays an error

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)
cli, git
A CLI for managing starred Git repositories
Home page: https://github.com/hoop33/limo
URL: https://github.com/hoop33/limo.git
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) 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