Documentation
¶
Index ¶
- func ChangeWorkingDirToBinPath(isWinSvc bool) error
- func CidrToNetmask(bits int) (string, error)
- func CreateTarGz(destFile string, srcDir string) error
- func CreateTarGzFromList(output string, paths []string, useStopOnErro bool) error
- func ExtractTarGz(tarGzPath, destDir string) error
- func GiByteToGByte(gibibyte int) int
- func GiByteToGByteStr(gibibyte int) string
- func HexToInt64WithDefault(in string, dft int64) int64
- func IsLinux() bool
- func KiByteToKByte(kibibytes int) int
- func KiByteToKByteStr(kibibytes int) string
- func LogoPrint(pName string)
- func MiByteToMByte(mebibyte int) int
- func MiByteToMByteStr(mebibyte int) string
- func ParseVersion(ver string) (major int, minor int, patch int)
- func PrintHex(in []byte, slice int)
- func RandomHex(n int) string
- func RemoveNewlines(s string) string
- func Rfc3339StrToTime(in string) time.Time
- func SafeStringFromMap(src map[string]interface{}, key string, dftValue string) string
- func SetDefaultTimeZone(name string)
- func ShortBytes(val uint64) string
- func ShortBytesIEC(val uint64) string
- func ShortDuration(d time.Duration) string
- func TimeToKST(in time.Time) time.Time
- func ToBool(in interface{}) (out bool)
- func ToFloat64(in interface{}) (out float64)
- func ToInt(in interface{}) (out int)
- func ToInt64(in interface{}) (out int64)
- func ToMaskString(in interface{}) (out string)
- func ToString(in interface{}) (out string)
- func ToUint(in interface{}) (out uint)
- func ToUint64(in interface{}) (out uint64)
- func TruncateWithEllipsis(s string, limit int) string
- func UnitByteToByte(val uint64, unit string) uint64
- type ResLinuxKernelVersion
- type ResLinuxOsRelease
- type ResNetworkInterface
- type ResNetworkInterfaceAddress
- type ResPhysicalInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CidrToNetmask ¶
func CreateTarGz ¶ added in v1.0.7
func CreateTarGzFromList ¶ added in v1.0.8
createTarGz creates a tar.gz archive with the given paths
func ExtractTarGz ¶ added in v1.0.7
func GiByteToGByte ¶
Gibibytes to Gigabytes
- Gigabytes = Gibibytes x (1024x1024x1024) ÷ (1000x1000x1000)
- Gigabytes = Gibibytes x 1.073741824
func GiByteToGByteStr ¶
func HexToInt64WithDefault ¶ added in v1.0.30
in: 입력값 (ex 0xA1b2, 0Xa1B2) 반환값: int64
- 빈문자열(") 일 경우 dft 반환됨.
- 변환 실패 또는 int64 최대 값을 초과한 경우 dft 반환됨
func KiByteToKByte ¶
Kibibytes to Kilobytes
- Kilobytes = Kibibytes x 1024 ÷ 1000
- Kilobytes = Kibibytes x 1.024
func KiByteToKByteStr ¶
func MiByteToMByte ¶
Mebibytes to Megabytes
- Megabytes = Mebibytes x (1024x1024) ÷ (1000x1000)
- Megabytes = Mebibytes x 1.048576
func MiByteToMByteStr ¶
func ParseVersion ¶ added in v1.0.23
func RemoveNewlines ¶ added in v1.0.11
func Rfc3339StrToTime ¶ added in v1.0.31
RFC3339 문자열 형식의 시간을 time 으로 변환 입력 :
- in : "2026-02-19T01:23:45Z"
출력 :
- 실패 : time.Time 반환 (zero time)
- 성공 : time.Time 반환
func SafeStringFromMap ¶ added in v1.0.9
func SetDefaultTimeZone ¶
func SetDefaultTimeZone(name string)
name: "loc", "UTC", "America/New_York", "Asia/Seoul"
func ShortBytes ¶
func ShortBytesIEC ¶
func ShortDuration ¶
func TimeToKST ¶ added in v1.0.31
time 을 KST 로 변환 출력 :
- 실패 : time.Time 반환 (zero time)
- 성공 : time.Time 반환
func ToMaskString ¶ added in v1.0.25
func ToMaskString(in interface{}) (out string)
func TruncateWithEllipsis ¶ added in v1.0.32
func UnitByteToByte ¶
함수 내에서 unit 을 ToLower + TrimSpace 처리함 unit : kb, mb, gb, tb
Types ¶
type ResLinuxKernelVersion ¶ added in v1.0.13
type ResLinuxKernelVersion struct {
VersionString string
Version struct {
Major int
Minor int
Patch int
Extra string
}
}
func GetLinuxKernelVersion ¶ added in v1.0.13
func GetLinuxKernelVersion() (ResLinuxKernelVersion, error)
type ResLinuxOsRelease ¶ added in v1.0.15
type ResLinuxOsRelease struct {
Name string
VersionString string
Version struct {
Major int
Minor int
Patch int
Extra string
}
}
func GetLinuxOsRelease ¶ added in v1.0.13
func GetLinuxOsRelease() (ResLinuxOsRelease, error)
type ResNetworkInterface ¶ added in v1.0.21
type ResNetworkInterface struct {
Type string `json:"type"` // 인터페이스 타입 (Physical, Virtual 등)
Name string `json:"name"` // 인터페이스 이름
Mac string `json:"mac"` // MAC 주소
Addresses []ResNetworkInterfaceAddress `json:"addresses,omitempty"` // Addresses
}
func GetNetworkInterfaces ¶ added in v1.0.21
func GetNetworkInterfaces() (ret []ResNetworkInterface, err error)
GetPhysicalInterfaces : 물리 네트워크 인터페이스 목록 조회 함수
type ResNetworkInterfaceAddress ¶ added in v1.0.21
type ResPhysicalInterface ¶ added in v1.0.18
type ResPhysicalInterface struct {
Name string `json:"name"` // 인터페이스 이름
Type string `json:"type"` // 인터페이스 타입 (Physical, Virtual 등)
Mac string `json:"mac"` // MAC 주소
Cidr string `json:"cidr"` // Classless Inter-Domain Routing
Ip string `json:"ip"` // IPv4 주소
Netmask string `json:"netmask"` // 넷마스크
}
func GetPhysicalInterfaces ¶ added in v1.0.18
func GetPhysicalInterfaces() ([]ResPhysicalInterface, error)
GetPhysicalInterfaces : 물리 네트워크 인터페이스 목록 조회 함수
Click to show internal directories.
Click to hide internal directories.