Documentation
¶
Overview ¶
* @Author: kamalyes 501893067@qq.com * @Date: 2023-07-28 00:50:58 * @LastEditors: kamalyes 501893067@qq.com * @LastEditTime: 2024-11-09 20:09:14 * @FilePath: \go-toolbox\pkg\osx\base.go * @Description: * * Copyright (c) 2024 by kamalyes, All Rights Reserved.
* @Author: kamalyes 501893067@qq.com * @Date: 2024-10-28 09:52:21 * @LastEditors: kamalyes 501893067@qq.com * @LastEditTime: 2024-10-28 10:10:17 * @FilePath: \go-toolbox\pkg\osx\file.go * @Description: * * Copyright (c) 2024 by kamalyes, All Rights Reserved.
* @Author: kamalyes 501893067@qq.com * @Date: 2024-10-24 11:25:16 * @LastEditors: kamalyes 501893067@qq.com * @LastEditTime: 2024-11-08 13:18:55 * @FilePath: \go-toolbox\pkg\osx\pool.go * @Description: * * Copyright (c) 2024 by kamalyes, All Rights Reserved.
Index ¶
- func CheckImageExists(filename string) error
- func GetClientPublicIP(r *http.Request) (string, error)
- func GetConNetPublicIp(urls ...string) (string, error)
- func GetDirFiles(dir string) ([]string, error)
- func GetHostName() (string, error)
- func GetLocalInterfaceIeIp() (string, string, error)
- func GetLocalInterfaceIps() ([]net.IP, error)
- func HashUnixMicroCipherText() string
- func SafeGetHostName() string
- func SaveImage(filename string, imgData []byte, quality int) error
- type LimitedPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckImageExists ¶
CheckImageExists 检查图像文件是否存在并且有效
func GetClientPublicIP ¶ added in v0.11.5
GetClientPublicIP 从HTTP请求中获取客户端的公网IP地址。 如果无法确定公网IP,则返回空字符串和错误(如果适用)。
func GetConNetPublicIp ¶ added in v0.11.5
GetConNetPublicIp 联网获取本机公网 IP
func GetDirFiles ¶
GetDirFiles 获取指定目录及其子目录下的所有文件路径 参数:dir - 目录路径 返回:所有文件的路径切片和可能的错误
func GetLocalInterfaceIeIp ¶ added in v0.11.5
GetLocalInterfaceIeIp 返回本地网卡对应的外部和内部 IP 地址
func GetLocalInterfaceIps ¶ added in v0.11.5
GetLocalInterfaceIps 查询本机网卡所有IP
Types ¶
type LimitedPool ¶ added in v0.11.5
type LimitedPool struct {
// contains filtered or unexported fields
}
LimitedPool 管理多个 levelPool,以支持不同大小的字节切片
func NewLimitedPool ¶ added in v0.11.5
func NewLimitedPool(minSize, maxSize int) *LimitedPool
NewLimitedPool 创建一个新的 LimitedPool,指定最小和最大大小
func (*LimitedPool) Get ¶ added in v0.11.5
func (p *LimitedPool) Get(size int) *[]byte
Get 从池中获取指定大小的字节切片