Help us shape the future of Go! Take the 2026 Go Developer Survey

printer

package module
v0.0.0-...-4c6faac Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

README

Printer

Printer provides a minimal and powerful interface to print colored labels and text in the terminal.

screen

Installation

$ go get github.com/m4ll0k/printer

OR:

$ wget https://raw.githubusercontent.com/m4ll0k/printer/master/printer.go
$ mv printer.go myproject/lib

Supported

Supported Labels:

// [i] ...
printer.Info(str string, color bool)
// [+] ...
printer.Plus(str string, color bool)
// [-] ..
printer.Less(str string, color bool)
// [*] ..
printer.Test(str string, color bool)
// [!] ...
printer.Warn(str string, color bool)
// [?] ...
printer.Ask(str string, color bool)

Usage

// print the string without color
printer.Info("Hello Word..",false)

// print the string with color
printer.Info("Hello Word..",true)

// print sigle color

fmt.Printf("%sMy String Here%s\n",printer.YELLOW,printer.RESET)

// Costum your print
fmt.Printf("%s%s%s %sHello Word!%s\n",printer.RED,printer.WARN,printer.RESET,printer.LRED,printer.RESET)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ASK = "[?]"
View Source
var BLACK = "\033[1;30m" // black

colors

View Source
var BLUE = "\033[1;34m"
View Source
var CYAN = "\033[1;36m"
View Source
var GRAY = "\033[1;37m"
View Source
var GREEN = "\033[1;32m"
View Source
var INFO = "[i]"

labels

View Source
var LBLACK = "\033[0;30m" // light black
View Source
var LBLUE = "\033[0;34m"
View Source
var LCYAN = "\033[0;36m"
View Source
var LESS = "[-]"
View Source
var LGRAY = "\033[0;37m"
View Source
var LGREEN = "\033[0;32m"
View Source
var LPURPLE = "\033[0;35m"
View Source
var LRED = "\033[0;31m"
View Source
var LWHITE = "\033[0;38m"
View Source
var LYELLOW = "\033[0;33m"
View Source
var PLUS = "[+]"
View Source
var PURPLE = "\033[1;35m"
View Source
var RED = "\033[1;31m"
View Source
var RESET = "\033[0m"
View Source
var TEST = "[*]"
View Source
var WARN = "[!]"
View Source
var WHITE = "\033[1;38m"
View Source
var YELLOW = "\033[1;33m"

Functions

func Ask

func Ask(str string, color bool)

func Info

func Info(str string, color bool)

func Less

func Less(str string, color bool)

func Plus

func Plus(str string, color bool)

func Test

func Test(str string, color bool)

func Warn

func Warn(str string, color bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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