utils

package
v0.0.0-...-724b653 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DESDecrypt

func DESDecrypt(src []byte, key []byte) ([]byte, error)

DESDecrypt 使用 DES 解密二进制数据

func DESEncrypt

func DESEncrypt(src []byte, key []byte) ([]byte, error)

DESEncrypt 使用 DES 加密二进制数据

func DeepCopyJson

func DeepCopyJson(src, dst interface{}) error

func DeepCopyJsonGob

func DeepCopyJsonGob(src, dst interface{}) error

func GetFreePort

func GetFreePort() (int, error)

GetFreePort 尝试绑定一个临时端口并返回该端口号

func GetLocalIP

func GetLocalIP() (string, error)

GetLocalIP 获取本地 IP 地址

func IsPortAvailable

func IsPortAvailable(port int) bool

IsPortAvailable 检查指定端口是否可用

func IsValidIPv4

func IsValidIPv4(ip string) bool

IsValidIPv4 检查字符串是否为有效的 IPv4 地址

func IsValidIPv6

func IsValidIPv6(ip string) bool

IsValidIPv6 检查字符串是否为有效的 IPv6 地址

func OsClose

func OsClose() (ch chan os.Signal)

func SendTCPRequest

func SendTCPRequest(address string, port int, data []byte) error

SendTCPRequest 发送一个简单的TCP请求到指定地址和端口

func SingleGetKey

func SingleGetKey(key string, fn func() (interface{}, error)) (interface{}, error, bool)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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