config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRefreshRate represents the refresh interval.
	DefaultRefreshRate = 1 // secs

	// DefaultLogLevel represents the default log level.
	DefaultLogLevel = "info"

	// DefaultPortNum represents the default port number.
	DefaultPortNum = 8080

	// DefaultAddress represents the default address.
	DefaultAddress = "localhost"

	// DefaultLogLength represents the default log length.
	DefaultLogLength = 1000

	// DefaultSortColumn represents the default sort column.
	DefaultSortColumn = "NAME"
)
View Source
const (
	EnvVarNamePort       = "PC_PORT_NUM"
	EnvVarNameTui        = "PC_DISABLE_TUI"
	EnvVarNameConfig     = "PC_CONFIG_FILES"
	EnvVarNameNoServer   = "PC_NO_SERVER"
	EnvVarUnixSocketPath = "PC_SOCKET_PATH"
)
View Source
const (
	LogPathEnvVarName = "PC_LOG_FILE"
	LogFileFlags      = os.O_CREATE | os.O_APPEND | os.O_WRONLY | os.O_TRUNC
	LogFileMode       = os.FileMode(0600)
)
View Source
const (
	CustomStyleName = "Custom Style"
)

Variables

View Source
var (
	Version           = "undefined"
	Commit            = "undefined"
	Date              = "undefined"
	CheckForUpdates   = "false"
	License           = "Apache-2.0"
	Discord           = "https://discord.gg/S4xgmRSHdC"
	ProjectName       = "Process Compose 🔥"
	RemoteProjectName = "Process Compose ⚡"
)

Functions

func GetConfigDefault added in v0.65.0

func GetConfigDefault() []string

func GetLogFilePath added in v0.43.1

func GetLogFilePath() string

func GetSettingsPath added in v1.0.0

func GetSettingsPath() string

func GetShortCutsPath added in v0.29.4

func GetShortCutsPath() string

func GetThemesPath added in v1.0.0

func GetThemesPath() string

func GetUnixSocketPath added in v1.2.0

func GetUnixSocketPath() string

func IsLogSelectionOn added in v0.80.0

func IsLogSelectionOn() bool

Types

type Body added in v1.0.0

type Body struct {
	FgColor            Color `yaml:"fgColor"`
	BgColor            Color `yaml:"bgColor"`
	SecondaryTextColor Color `yaml:"secondaryTextColor"`
	TertiaryTextColor  Color `yaml:"tertiaryTextColor"`
	BorderColor        Color `yaml:"borderColor"`
}

Body tracks body styles.

type Color added in v1.0.0

type Color string

Color represents a color.

const (
	// DefaultColor represents  a default color.
	DefaultColor Color = "default"

	// TransparentColor represents the terminal bg color.
	TransparentColor Color = "-"
)

func NewColor added in v1.0.0

func NewColor(c string) Color

NewColor returns a new color.

func (Color) Color added in v1.0.0

func (c Color) Color() tcell.Color

Color returns a view color.

func (Color) String added in v1.0.0

func (c Color) String() string

String returns color as string.

type Colors added in v1.0.0

type Colors []Color

Colors tracks multiple colors.

func (Colors) Colors added in v1.0.0

func (c Colors) Colors() []tcell.Color

Colors converts series string colors to colors.

type Dialog added in v1.0.0

type Dialog struct {
	FgColor            Color `yaml:"fgColor"`
	BgColor            Color `yaml:"bgColor"`
	ButtonFgColor      Color `yaml:"buttonFgColor"`
	ButtonBgColor      Color `yaml:"buttonBgColor"`
	ButtonFocusFgColor Color `yaml:"buttonFocusFgColor"`
	ButtonFocusBgColor Color `yaml:"buttonFocusBgColor"`
	LabelFgColor       Color `yaml:"labelFgColor"`
	FieldFgColor       Color `yaml:"fieldFgColor"`
	FieldBgColor       Color `yaml:"fieldBgColor"`
}

Dialog tracks dialog styles.

type Flags added in v0.65.0

type Flags struct {
	RefreshRate       *int
	PortNum           *int
	Address           *string
	LogLevel          *string
	LogFile           *string
	LogLength         *int
	LogFollow         *bool
	LogTailLength     *int
	Headless          *bool
	Command           *string
	Write             *bool
	NoDependencies    *bool
	HideDisabled      *bool
	SortColumn        *string
	IsReverseSort     *bool
	NoServer          *bool
	KeepTuiOn         *bool
	IsOrderedShutDown *bool
	PcTheme           *string
	UnixSocketPath    *string
	IsUnixSocket      *bool
}

Flags represents PC configuration flags.

func NewFlags added in v0.65.0

func NewFlags() *Flags

NewFlags returns new configuration flags.

type Help added in v1.0.0

type Help struct {
	KeyColor        Color `yaml:"keyColor"`
	FgColor         Color `yaml:"fgColor"`
	HlColor         Color `yaml:"hlColor"`
	FgCategoryColor Color `yaml:"categoryFgColor"`
}

Help tracks help styles.

type ProcTable added in v1.0.0

type ProcTable struct {
	FgColor       Color `yaml:"fgColor"`
	FgWarning     Color `yaml:"fgWarning"`
	FgPending     Color `yaml:"fgPending"`
	FgCompleted   Color `yaml:"fgCompleted"`
	FgError       Color `yaml:"fgError"`
	BgColor       Color `yaml:"bgColor"`
	HeaderFgColor Color `yaml:"headerFgColor"`
}

ProcTable tracks processes table styles.

type Settings added in v1.0.0

type Settings struct {
	Theme string `yaml:"theme"`
	Sort  Sort   `yaml:"sort"`
}

func NewSettings added in v1.0.0

func NewSettings() *Settings

func (*Settings) Load added in v1.0.0

func (s *Settings) Load() *Settings

func (*Settings) Save added in v1.0.0

func (s *Settings) Save() error

type Sort added in v1.0.0

type Sort struct {
	By         string `yaml:"by"`
	IsReversed bool   `yaml:"isReversed"`
}

type StatTable added in v1.0.0

type StatTable struct {
	KeyFgColor   Color `yaml:"keyFgColor"`
	ValueFgColor Color `yaml:"valueFgColor"`
	BgColor      Color `yaml:"bgColor"`
	LogoColor    Color `yaml:"logoColor"`
}

StatTable tracks stats table styles.

type Style added in v1.0.0

type Style struct {
	Name      string    `yaml:"name"`
	Body      Body      `yaml:"body"`
	StatTable StatTable `yaml:"stat_table"`
	ProcTable ProcTable `yaml:"proc_table"`
	Help      Help      `yaml:"help"`
	Dialog    Dialog    `yaml:"dialog"`
}

Style tracks PC styles.

type StyleListener added in v1.0.0

type StyleListener interface {
	// StylesChanged notifies listener the skin changed.
	StylesChanged(*Styles)
}

StyleListener represents a skin's listener.

type Styles added in v1.0.0

type Styles struct {
	Style Style `yaml:"style"`
}

Styles tracks process compose styling options.

func NewStyles added in v1.0.0

func NewStyles() *Styles

NewStyles creates a new default config.

func (*Styles) BgColor added in v1.0.0

func (s *Styles) BgColor() tcell.Color

BgColor returns the background color.

func (*Styles) Body added in v1.0.0

func (s *Styles) Body() Body

Body returns body styles.

func (*Styles) BorderColor added in v1.0.0

func (s *Styles) BorderColor() tcell.Color

BorderColor returns the border color.

func (*Styles) Dialog added in v1.0.0

func (s *Styles) Dialog() Dialog

Dialog returns dialog styles.

func (*Styles) Dump added in v1.0.0

func (s *Styles) Dump(w io.Writer)

Dump for debug.

func (*Styles) FgColor added in v1.0.0

func (s *Styles) FgColor() tcell.Color

FgColor returns the foreground color.

func (*Styles) GetStyleName added in v1.0.0

func (s *Styles) GetStyleName() string

GetStyleName returns the style name

func (*Styles) Help added in v1.0.0

func (s *Styles) Help() Help

Help returns help styles.

func (*Styles) Load added in v1.0.0

func (s *Styles) Load(path string) error

Load process compose styles from file.

func (*Styles) ProcTable added in v1.0.0

func (s *Styles) ProcTable() ProcTable

ProcTable returns process table styles.

func (*Styles) StatTable added in v1.0.0

func (s *Styles) StatTable() StatTable

StatTable returns stat table styles.

func (*Styles) Update added in v1.0.0

func (s *Styles) Update()

Update apply terminal colors based on styles.

type Themes added in v1.0.0

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

Themes represents a list of styles.

func NewThemes added in v1.0.0

func NewThemes() *Themes

func (*Themes) AddListener added in v1.0.0

func (t *Themes) AddListener(l StyleListener)

AddListener registers a new listener.

func (*Themes) GetActiveStyles added in v1.0.0

func (t *Themes) GetActiveStyles() *Styles

GetActiveStyles returns the active styles.

func (*Themes) GetThemeNames added in v1.0.0

func (t *Themes) GetThemeNames() []string

func (*Themes) RemoveListener added in v1.0.0

func (t *Themes) RemoveListener(l StyleListener)

RemoveListener removes a listener.

func (*Themes) SelectStyles added in v1.0.0

func (t *Themes) SelectStyles(name string)

func (*Themes) SelectStylesFromFile added in v1.0.0

func (t *Themes) SelectStylesFromFile()

Jump to

Keyboard shortcuts

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