text

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package text defines the Text type that is used to represent blocks of ANSI formatted text. The package also defines generated helper functions for creating different coloured blocks of text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Text

type Text struct {
	// contains filtered or unexported fields
}

A Text represents a string and a colour.

func Blue added in v0.8.1

func Blue(text string) Text

Blue returns a Text struct that wraps the supplied text in ANSI colour

func Bold

func Bold(text string) Text

Bold returns a Text struct that wraps the supplied text in ANSI colour

func Green

func Green(text string) Text

Green returns a Text struct that wraps the supplied text in ANSI colour

func Grey

func Grey(text string) Text

Grey returns a Text struct that wraps the supplied text in ANSI colour

func Orange

func Orange(text string) Text

Orange returns a Text struct that wraps the supplied text in ANSI colour

func Plain

func Plain(text string) Text

Plain returns a Text struct that always returns the supplied text, unformatted

func Red

func Red(text string) Text

Red returns a Text struct that wraps the supplied text in ANSI colour

func White

func White(text string) Text

White returns a Text struct that wraps the supplied text in ANSI colour

func Yellow

func Yellow(text string) Text

Yellow returns a Text struct that wraps the supplied text in ANSI colour

func (Text) Format added in v0.8.0

func (t Text) Format() string

Format returns the Text as a formatted string

func (Text) Len

func (t Text) Len() int

Len returns the length of the text

func (Text) Plain

func (t Text) Plain() string

Plain returns the unformatted text

func (Text) String

func (t Text) String() string

String returns a formatted (if supported) string of the Text

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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