Documentation ¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type AnsiColor
- type AsciiRender
- type Color
- type Parser
- type RenderOptions
- type TrueColor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type AnsiColor ¶
type AnsiColor struct {
// contains filtered or unexported fields
}
AnsiColor representation
var ( ColorBlack AnsiColor = AnsiColor{30} ColorRed AnsiColor = AnsiColor{31} ColorGreen AnsiColor = AnsiColor{32} ColorYellow AnsiColor = AnsiColor{33} ColorBlue AnsiColor = AnsiColor{34} ColorMagenta AnsiColor = AnsiColor{35} ColorCyan AnsiColor = AnsiColor{36} ColorWhite AnsiColor = AnsiColor{37} )
Terminal AnsiColors
type AsciiRender ¶
type AsciiRender struct {
// contains filtered or unexported fields
}
AsciiRender is the wrapper to render a string
func (*AsciiRender) LoadBindataFont ¶
func (ar *AsciiRender) LoadBindataFont(fontBinary []byte, fontName string) error
LoadBinDataFont loads provided font binary
func (*AsciiRender) LoadFont ¶
func (ar *AsciiRender) LoadFont(fontPath string) error
LoadFont loads all *.flf font files recursively in a path
func (*AsciiRender) Render ¶
func (ar *AsciiRender) Render(str string) (string, error)
Render renders a string with the default options Calls the RenderOpts method with a new RenderOptions object
func (*AsciiRender) RenderOpts ¶
func (ar *AsciiRender) RenderOpts(str string, opt *RenderOptions) (string, error)
RenderOpts renders a string with special RenderOptions Can be called from the user (if options wished) or the above Render method Contains the whole rendering logic
type Color ¶
type Color interface {
// contains filtered or unexported methods
}
Color has a pre- and a suffix
type Parser ¶
type Parser struct { // Name used for switching in colors.go Name string // Parser prefix Prefix string // Parser suffix Suffix string // Newline representation NewLine string // Things to be replaced (f.e. \n to <br>) Replaces map[string]string }
Parser stores some output specific stuff
type RenderOptions ¶
type RenderOptions struct { // Name of the used font FontName string // Colors of the font FontColor []Color // Parser Parser Parser }
RenderOptions are used to set color or maybe future options to the AsciiRenderer
func NewRenderOptions ¶
func NewRenderOptions() *RenderOptions
NewRenderOptions creates new RenderOptions Sets the default font name