car

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Shell = utils.GetEnv("GBT_SHELL", path.Base(utils.GetEnv("SHELL", "bash")))

Shell type.

Functions

This section is empty.

Types

type Car

type Car struct {
	Model   map[string]ModelElement
	Display bool
	Sep     string
	Wrap    bool
	Params  map[string]interface{}
}

Car is a type defining the model of the car.

func (*Car) DecorateElement

func (c *Car) DecorateElement(element, bg, fg, fm, text string) string

DecorateElement decorates the element text with its colors and formatting.

func (*Car) Format

func (c *Car) Format() string

Format initiates replacement of all templating elements.

func (*Car) GetColor

func (c *Car) GetColor(name string, isFg bool) (ret string)

GetColor returns color sequence based on the color name or code.

func (*Car) GetDisplay

func (c *Car) GetDisplay() bool

GetDisplay returns the Display value.

func (*Car) GetFormat

func (c *Car) GetFormat(name string, end bool) (ret string)

GetFormat returns formatting sequence based on the format name.

func (*Car) GetModel

func (c *Car) GetModel() map[string]ModelElement

GetModel returns the Model value.

func (*Car) GetSep

func (c *Car) GetSep() string

GetSep returns the Sep value.

func (*Car) GetWrap

func (c *Car) GetWrap() bool

GetWrap returns the Wrap value.

func (*Car) SetParamStr

func (c *Car) SetParamStr(name, value string)

SetParamStr sets string value to a parameter.

type ModelElement

type ModelElement struct {
	Bg   string
	Fg   string
	Fm   string
	Text string
}

ModelElement is an element of which the car model is constructed from.

Jump to

Keyboard shortcuts

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