utils

package module
v0.0.0-...-3d6b090 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ESC string = "\033["
	// text color
	BLACK  string = ESC + "30m"
	RED    string = ESC + "31m"
	GREEN  string = ESC + "32m"
	BROWN  string = ESC + "33m"
	BLUE   string = ESC + "34m"
	PURPLE string = ESC + "35m"
	CYAN   string = ESC + "36m"
	GRAY   string = ESC + "37m"

	// background color
	BKG_BLACK  string = ESC + "40m"
	BKG_RED    string = ESC + "41m"
	BKG_GREEN  string = ESC + "42m"
	BKG_BROWN  string = ESC + "43m"
	BKG_BLUE   string = ESC + "44m"
	BKG_PURPLE string = ESC + "45m"
	BKG_CYAN   string = ESC + "46m"
	BKG_GRAY   string = ESC + "47m"

	// font
	BOLD      string = ESC + "1m"
	UNDERLINE string = ESC + "4m"
	BLINK     string = ESC + "5m"
	INVERSION string = ESC + "7m"

	// end
	RESET string = ESC + "0m"

	// other
	QUOTES   string = ESC + "4b"
	PUSH_POS string = ESC + "s"
	POP_POS  string = ESC + "u"
	CLR_BGN  string = ESC + "1K"
	CLR_STR  string = ESC + "2K"
	CLR_SCR  string = ESC + "2J"

	SET_HOME  string = ESC + "H"
	SET_POS   string = ESC + "%d;%dH"
	UP_POS    string = ESC + "%dA"
	DWN_POS   string = ESC + "%dB"
	FRWRD_POS string = ESC + "%dC"
	RVRS_POS  string = ESC + "%dD"
	CURS_DIS  string = ESC + "?25l"
	CURS_EN   string = ESC + "?25h"
)

Variables

This section is empty.

Functions

func AppendFile

func AppendFile(pfname, content *string) error

func Counter

func Counter(count int) kb.KeyEvent

func GetArch

func GetArch() (*string, error)

func GetCurrentFuncName

func GetCurrentFuncName() string

getCurrentFuncName will return the current function's name. It can be used for a better log debug system.(I'm NOT sure.) https://gist.github.com/HouLinwei/ => Ctrl+F => golang-get-the-function's-name.go

func GetKernelVer

func GetKernelVer() (*string, error)

func GetMACfromIP

func GetMACfromIP(ip string) (string, error)

func GetSizeMem

func GetSizeMem() int

func LogRoll

func LogRoll(pfname string)

logroll

checking for the presence of the build directory and log files

func MakeFile

func MakeFile(pfname, content *string) error

func MkTmpName

func MkTmpName(prefix string) string

func ResolveHostIp

func ResolveHostIp() (string, error)

func Roll

func Roll(x, y int)

roll <arg>

rolling |/-\ etc.. про позиционирование курсора: https://docs.microsoft.com/ru-ru/windows/console/console-virtual-terminal-sequences http://microsin.net/adminstuff/xnix/ansivt100-terminal-control-escape-sequences.html

type Coord struct {
	X, Y int
}

(self *Coord)

Types

type TRoll

type TRoll struct {
	RollQuit chan bool
}

func (*TRoll) RollWrap

func (self *TRoll) RollWrap(x, y int)

Jump to

Keyboard shortcuts

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