Documentation
¶
Index ¶
- Constants
- Variables
- func Base64ConvertToImageAndSave2Local(_base64String string, _path string) bool
- func Base64ToBytes(_data_string string) []byte
- func ByteArraySearch(_data []byte, _start int, _end int, _comp []byte) int
- func Bytes2File(_fn string, _content []byte) bool
- func Bytes2Hex(_b byte) string
- func BytesToBase64String(_data []byte) string
- func ConsolePrint(_msg string)
- func DecodeWebClientData(_data []byte, _length int) []byte
- func DeleteFile(_fn string) bool
- func DisableUncaughtExceptionHandler()
- func EnableUncaughtExceptionHandler(_serviceName string, _threshold int, _callback func())
- func EncodeWebClientData(_data []byte, _length int) []byte
- func ExceptionToString(_err interface{}) string
- func File2Bytes(_fn string) []byte
- func File2String(_fn string) string
- func ForceFlushMemory()
- func GetCurrentDateTimeString() string
- func GetFullMachineID() string
- func GetImageFromURL(_imageURL string, _authorization string, _timeoutMs int) []byte
- func GetInternetIPv4Address() string
- func GetLocalIPv4Address() string
- func GetLocalMACAddress(_seperator string) string
- func GetLocalMACAddressByConsoleCMD(_seperator string) string
- func GetLocalTime() int64
- func GetMachineID() string
- func GetMethodName(_class interface{}) string
- func GetOSName() string
- func GetPID(cmd *exec.Cmd) int
- func GetProcessCPUUsage() float64
- func GetProcessMemoryUsage() int64
- func GetSystemCPUUsage() float64
- func GetSystemMemoryUsage() int64
- func GetUTC() int64
- func GlobalRecovery()
- func HttpGet(_url string, _authToken string, _timeoutMs int) string
- func HttpGetAsync(_url string, _callback func([]byte))
- func HttpGet_BytesData(_url string, _authToken string, _timeoutMs int) []byte
- func HttpPost(_url string, _authToken string, _contentType string, _content string, ...) string
- func HttpPostWithHeaders(_url string, _headers map[string]string, _contentType string, _content string, ...) string
- func HttpPost_BytesData(_url string, _authToken string, _ignoreSSL bool, _contentType string, ...) []byte
- func If(condition bool, trueVal any, falseVal any) any
- func IsFileExists(_fn string) bool
- func IsHostAlive(_host string, _timeout int) bool
- func IsJSONValid(_src string) bool
- func IsLinux() bool
- func IsMSWindow() bool
- func IsMacOS() bool
- func IsPortInUsing(_port int) bool
- func KillProcess(pid string) bool
- func ParseURLParams(_paramString string) map[string]string
- func ReadLineFromKeyIn() string
- func RestartItSelf() error
- func SHA1ToBytes(_data_string string) []byte
- func SafeRun(_task func())
- func SendCommunityText(_vendor, _from, _to, _text string) string
- func SendEMail(_sender map[string]interface{}, _to string, _subject string, ...) bool
- func SendEMailAttachment(_sender map[string]interface{}, _to string, _subject string, _msgType string, ...) bool
- func SendMulticastData(_multicastGroup string, _multicastPort int, _data []byte)
- func ShellCMD(cmds ...string) *exec.Cmd
- func ShellCMDAsync(callback IShellCMDCallback, cmds ...string)
- func ShellCMDSync(_cmds ...string) string
- func ShellCMDWithPah(path string, cmds ...string) *exec.Cmd
- func Sleep(_ms int)
- func TransformComposedID(_composedID string) []string
- func TransformID(_uuid string, _suid string) string
- func XValueCompare(_a interface{}, _b interface{}) string
- type IShellCMDCallback
- type LogLevel
- type LogOut
- type Stopwatch
Constants ¶
const ( DefaultCharset = "UTF-8" DefaultTimeout = 15 * time.Second )
------------------------------------------------------------------------------------- 模擬 Java 的常量 -------------------------------------------------------------------------------------
Variables ¶
var Log = createLogger()
------------------------------------------------------------------------------------- 日誌系統 (簡化版 LogOut) -------------------------------------------------------------------------------------
Functions ¶
func Base64ConvertToImageAndSave2Local ¶
-------------------------------------------------------------------------------------
func Base64ToBytes ¶
-------------------------------------------------------------------------------------
func ByteArraySearch ¶
------------------------------------------------------------------------------------- 資料處理 -------------------------------------------------------------------------------------
func Bytes2File ¶
-------------------------------------------------------------------------------------
func Bytes2Hex ¶
-------------------------------------------------------------------------------------
func BytesToBase64String ¶
------------------------------------------------------------------------------------- 加密與編碼 -------------------------------------------------------------------------------------
func ConsolePrint ¶
func ConsolePrint(_msg string)
-------------------------------------------------------------------------------------
func DecodeWebClientData ¶
------------------------------------------------------------------------------------- Websocket 處理 -------------------------------------------------------------------------------------
func DeleteFile ¶
-------------------------------------------------------------------------------------
func DisableUncaughtExceptionHandler ¶
func DisableUncaughtExceptionHandler()
-------------------------------------------------------------------------------------
func EnableUncaughtExceptionHandler ¶
-------------------------------------------------------------------------------------
func EncodeWebClientData ¶
-------------------------------------------------------------------------------------
func ExceptionToString ¶
func ExceptionToString(_err interface{}) string
-------------------------------------------------------------------------------------
func File2Bytes ¶
-------------------------------------------------------------------------------------
func File2String ¶
-------------------------------------------------------------------------------------
func ForceFlushMemory ¶
func ForceFlushMemory()
-------------------------------------------------------------------------------------
func GetCurrentDateTimeString ¶
func GetCurrentDateTimeString() string
-------------------------------------------------------------------------------------
func GetFullMachineID ¶
func GetFullMachineID() string
------------------------------------------------------------------------------------- 系統工具 -------------------------------------------------------------------------------------
func GetImageFromURL ¶
-------------------------------------------------------------------------------------
func GetInternetIPv4Address ¶
func GetInternetIPv4Address() string
-------------------------------------------------------------------------------------
func GetLocalIPv4Address ¶
func GetLocalIPv4Address() string
-------------------------------------------------------------------------------------
func GetLocalMACAddress ¶
------------------------------------------------------------------------------------- 網路功能 (Net) -------------------------------------------------------------------------------------
func GetLocalMACAddressByConsoleCMD ¶
------------------------------------------------------------------------------------- GetLocalMACAddressByConsoleCMD 執行系統指令獲取 MAC
func GetLocalTime ¶
func GetLocalTime() int64
func GetMachineID ¶
func GetMachineID() string
-------------------------------------------------------------------------------------
func GetMethodName ¶
func GetMethodName(_class interface{}) string
-------------------------------------------------------------------------------------
func GetPID ¶
------------------------------------------------------------------------------------- Process 功能 -------------------------------------------------------------------------------------
func GetProcessCPUUsage ¶
func GetProcessCPUUsage() float64
-------------------------------------------------------------------------------------
func GetProcessMemoryUsage ¶
func GetProcessMemoryUsage() int64
------------------------------------------------------------------------------------- 系統效能監控 -------------------------------------------------------------------------------------
func GetSystemCPUUsage ¶
func GetSystemCPUUsage() float64
-------------------------------------------------------------------------------------
func GetSystemMemoryUsage ¶
func GetSystemMemoryUsage() int64
-------------------------------------------------------------------------------------
func GetUTC ¶
func GetUTC() int64
-------------------------------------------------------------------------------------
func GlobalRecovery ¶
func GlobalRecovery()
-------------------------------------------------------------------------------------
func HttpGet ¶
-------------------------------------------------------------------------------------
func HttpGetAsync ¶
-------------------------------------------------------------------------------------
func HttpGet_BytesData ¶
------------------------------------------------------------------------------------- 網路功能 (HTTP) -------------------------------------------------------------------------------------
func HttpPost ¶
func HttpPost(_url string, _authToken string, _contentType string, _content string, _timeoutMs int) string
-------------------------------------------------------------------------------------
func HttpPostWithHeaders ¶
func HttpPostWithHeaders(_url string, _headers map[string]string, _contentType string, _content string, _timeoutMs int) string
-------------------------------------------------------------------------------------
func HttpPost_BytesData ¶
func HttpPost_BytesData(_url string, _authToken string, _ignoreSSL bool, _contentType string, _content string, _timeoutMs int) []byte
-------------------------------------------------------------------------------------
func IsFileExists ¶
func IsHostAlive ¶
-------------------------------------------------------------------------------------
func IsJSONValid ¶
-------------------------------------------------------------------------------------
func IsLinux ¶
func IsLinux() bool
-------------------------------------------------------------------------------------
func IsMSWindow ¶
func IsMSWindow() bool
-------------------------------------------------------------------------------------
func IsMacOS ¶
func IsMacOS() bool
-------------------------------------------------------------------------------------
func IsPortInUsing ¶
-------------------------------------------------------------------------------------
func KillProcess ¶
-------------------------------------------------------------------------------------
func ParseURLParams ¶
-------------------------------------------------------------------------------------
func ReadLineFromKeyIn ¶
func ReadLineFromKeyIn() string
------------------------------------------------------------------------------------- 其他工具 -------------------------------------------------------------------------------------
func RestartItSelf ¶
func RestartItSelf() error
-------------------------------------------------------------------------------------
func SHA1ToBytes ¶
-------------------------------------------------------------------------------------
func SafeRun ¶
func SafeRun(_task func())
-------------------------------------------------------------------------------------
func SendCommunityText ¶
-------------------------------------------------------------------------------------
func SendEMail ¶
func SendEMail(_sender map[string]interface{}, _to string, _subject string, _contentType string, _content string) bool
-------------------------------------------------------------------------------------
func SendEMailAttachment ¶
func SendEMailAttachment(_sender map[string]interface{}, _to string, _subject string, _msgType string, _msg string, _attType string, _attName string, _buffer []byte) bool
-------------------------------------------------------------------------------------
func SendMulticastData ¶
-------------------------------------------------------------------------------------
func ShellCMD ¶
-------------------------------------------------------------------------------------
func ShellCMDAsync ¶
func ShellCMDAsync(callback IShellCMDCallback, cmds ...string)
-------------------------------------------------------------------------------------
func ShellCMDSync ¶
-------------------------------------------------------------------------------------
func ShellCMDWithPah ¶
------------------------------------------------------------------------------------- 命令執行 (Shell CMD) -------------------------------------------------------------------------------------
func Sleep ¶
func Sleep(_ms int)
-------------------------------------------------------------------------------------
func TransformComposedID ¶
-------------------------------------------------------------------------------------
func TransformID ¶
-------------------------------------------------------------------------------------
func XValueCompare ¶
func XValueCompare(_a interface{}, _b interface{}) string
-------------------------------------------------------------------------------------
Types ¶
type IShellCMDCallback ¶
-------------------------------------------------------------------------------------
type LogLevel ¶
type LogLevel int
-------------------------------------------------------------------------------------
type LogOut ¶
type LogOut struct {
// contains filtered or unexported fields
}
-------------------------------------------------------------------------------------
func (*LogOut) Print ¶
-------------------------------------------------------------------------------------
func (*LogOut) SetDisplayLevel ¶
-------------------------------------------------------------------------------------
func (*LogOut) SetRemoteOutput ¶
-------------------------------------------------------------------------------------
type Stopwatch ¶
type Stopwatch struct {
// contains filtered or unexported fields
}
func CreateStopwatch ¶
func CreateStopwatch() *Stopwatch
-------------------------------------------------------------------------------------