config

package
v0.0.0-...-1bb8f00 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorAreaStatusBar     = "statusbar"
	ColorAreaDialog        = "dialog"
	ColorAreaMessageList   = "messageList"
	ColorAreaMessageHeader = "messageHeader"
	ColorAreaAreaList      = "areaList"
	ColorAreaAreaListModal = "areaListModal"
	ColorAreaEditor        = "editor"
	ColorAreaHelp          = "help"
	ColorAreaDefault       = "default"
)
View Source
const (
	ColorElementHeader    = "header"
	ColorElementSelection = "selection"
	ColorElementTitle     = "title"
	ColorElementItem      = "item"
	ColorElementHighlight = "highlight"
	ColorElementBorder    = "border"
	ColorElementText      = "text"
	ColorElementPrompt    = "prompt"
	ColorElementWindow    = "window"
)
View Source
const (
	StyleUnderline = "underline"
	StyleBold      = "bold"
	StyleReverse   = "reverse"
)

Variables

View Source
var (
	Version  string
	PID      string
	LongPID  string
	Config   configS
	Template []string

	StyleDefault tcell.Style
)

vars

Functions

func FormatTextWithStyle

func FormatTextWithStyle(text string, style tcell.Style) string

func GetCity

func GetCity(sfa *types.FidoAddr) string

GetCity return city

func GetElementStyle

func GetElementStyle(section string, element string) tcell.Style

func InitVars

func InitVars()

InitVars define version variables

func MaskToStringStyle

func MaskToStringStyle(attrMask tcell.AttrMask) string

func Read

func Read(fn string) error

Read config

func StringToColor

func StringToColor(str string) tcell.Color

StringToColor returns a tcell color from a string representation of a color

func StringToStyle

func StringToStyle(str string) (tcell.Style, error)

StringToStyle returns a style from a string The strings must be in the format "extra foregroundcolor,backgroundcolor" The 'extra' can be bold, reverse, or underline

Types

type ColorMap

type ColorMap map[string]string

func ProduceColorMapFromConfig

func ProduceColorMapFromConfig(colorArea string, fallbackColors *ColorMap) (*ColorMap, error)

type ColorScheme

type ColorScheme map[string]tcell.Style

func GetColors

func GetColors(section string) *ColorScheme

GetColors for config section

func ParseColorscheme

func ParseColorscheme(text string) ColorScheme

ParseColorscheme parses the text definition for a colorscheme and returns the corresponding object Colorschemes are made up of color-link statements linking a color group to a list of colors For example, color-link keyword (blue,red) makes all keywords have a blue foreground and red background Todo: Implement to read Golded schemes in future

func ProduceColorSchemeFromConfig

func ProduceColorSchemeFromConfig(colorArea string, defaultColors *ColorMap) *ColorScheme

ProduceColorSchemeFromConfig colorArea: node name in gossiped.yml defaultColors: pointer to default ColorMap values returns pointer to ColorScheme object

func (ColorScheme) GetColor

func (colorscheme ColorScheme) GetColor(color string) tcell.Style

GetColor takes in a syntax group and returns the colorscheme's style for that group

type ColorSchemeMap

type ColorSchemeMap map[string]*ColorScheme

type DefaultColorsMap

type DefaultColorsMap map[string]*ColorMap

type SortTypeMap

type SortTypeMap map[string]string

Jump to

Keyboard shortcuts

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