common

package module
v0.0.0-...-47eb4c0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: GPL-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CmdlineMaxRows = 10
)

Variables

This section is empty.

Functions

func AnyConfigFromFile

func AnyConfigFromFile(
	cfg interface{},
	cfgFileName string,
	customPath string,
)

func Cprinta

func Cprinta(
	alignment string,
	fg csi.FgColor,
	bg csi.BgColor,
	termW int,
	str string,
) (n int, err error)

func Cprintf

func Cprintf(
	fg csi.FgColor,
	bg csi.BgColor,
	format string,
	a ...any,
) (n int, err error)

func Cprintfa

func Cprintfa(
	alignment string,
	fg csi.FgColor,
	bg csi.BgColor,
	termW int,
	format string,
	a ...any,
) (n int, err error)

func Csprinta

func Csprinta(
	alignment string,
	fg csi.FgColor,
	bg csi.BgColor,
	termW int,
	str string,
) string

func Csprintf

func Csprintf(
	fg csi.FgColor,
	bg csi.BgColor,
	format string,
	a ...any,
) string

func Csprintfa

func Csprintfa(
	alignment string,
	fg csi.FgColor,
	bg csi.BgColor,
	termW int,
	format string,
	a ...any,
) string

func DrawUpper

func DrawUpper(
	comCfg ComConfig,
	header []string,
	termW int,
	title []string,
)

func GenerateLower

func GenerateLower(
	cmdline string,
	cmdMode bool,
	comCfg ComConfig,
	fb *Feedback,
	pagerTitle string,
	termW int,
) string

func HandleKeyCmdline

func HandleKeyCmdline(
	key string,
	active *bool,
	cmdLine *CmdLine,
	cmdMap ScriptCmdMap,
	comCfg *ComConfig,
	contentLineCount int,
	cursor *int,
	fb *Feedback,
)

func PrintAbout

func PrintAbout(
	appLicense,
	appLicenseUrl,
	appName,
	appNameFormal,
	appRepo,
	appVersion string,
)

func PrintVersion

func PrintVersion(
	appName string,
	appVersion string,
)

func SplitByLines

func SplitByLines(
	maxLineLen int,
	str string,
) []string

func ValidateAlignment

func ValidateAlignment(
	alignment string,
)

Types

type CmdLine

type CmdLine struct {
	Active  bool
	Content string
	Cursor  int
	Insert  bool
	RowIdx  int
	Rows    [CmdlineMaxRows]string
}

func NewCmdLine

func NewCmdLine() CmdLine

type ComAppData

type ComAppData struct {
	AcceptInput bool
	Active      bool
	CmdLine     CmdLine
	ComCfg      ComConfig
	Fb          Feedback
}

func NewComAppData

func NewComAppData(
	customPath string,
) ComAppData

type ComConfig

type ComConfig struct {
	Pagers   []pagerConfig
	Keys     keysConfig
	Header   headerConfig
	Title    titleConfig
	CmdLine  cmdlineConfig
	Feedback feedbackConfig
}

func ComConfigFromFile

func ComConfigFromFile(
	customPath string,
) ComConfig

type Feedback

type Feedback string

func HandleShell

func HandleShell(
	shell string,
) Feedback

func HandleShellSession

func HandleShellSession(
	shell string,
) Feedback

type ScriptCmd

type ScriptCmd func(cmd string) Feedback

type ScriptCmdMap

type ScriptCmdMap map[string]ScriptCmd

type ScriptFn

type ScriptFn func()

type ScriptFnMap

type ScriptFnMap map[string]ScriptFn

Jump to

Keyboard shortcuts

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