util

package
v0.0.0-...-87adcba Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelTrace = slog.Level(-8)
	LevelFatal = slog.Level(12)
	DebugLevel = 1
	TraceLevel = 2
)
View Source
const (
	CODESET     = 14
	LC_CTYPE    = 0
	LC_NUMERIC  = 1
	LC_TIME     = 2
	LC_COLLATE  = 3
	LC_MONETARY = 4
	LC_MESSAGES = 5
	LC_ALL      = 6
)
View Source
const (
	GetTermios = unix.TCGETS
	SetTermios = unix.TCSETS
)

Variables

View Source
var Logger *myLogger

Functions

func CheckIUTF8

func CheckIUTF8(fd int) (bool, error)

func ClearLocaleVariables

func ClearLocaleVariables()

func ConvertWinsize

func ConvertWinsize(windowSize *unix.Winsize) *pty.Winsize

func GetCtype

func GetCtype() localeVar

func GetShell

func GetShell() (string, error)

func GetShell4

func GetShell4(user *user.User) (string, error)

func IsUtf8Locale

func IsUtf8Locale() bool

return true if current locale charset is utf-8, otherwise false.

func LocaleCharset

func LocaleCharset() (ret string)

func SetIUTF8

func SetIUTF8(fd int) error

func SetNativeLocale

func SetNativeLocale() (ret string)

for alpine: musl setlocale doesn't return NULL

If its value is not a valid locale specification, the locale is unchanged, and setlocale() returns NULL.

If locale is an empty string, "", each part of the locale that should be modified is set according to the environment variables.

Types

This section is empty.

Jump to

Keyboard shortcuts

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