Documentation ¶
Index ¶
- Constants
- Variables
- func CleanPath(path string) string
- func CopyWithFilter(writer io.Writer, reader io.Reader, buf []byte, filter func(p []byte) []byte) (written int64, err error)
- func CutPrefix(s, prefix string) (after string, found bool)
- func DumpResponse(resp *http.Response) (header []byte, body []byte, err error)
- func EqualStrings(s1 []string, s2 []string) bool
- func Exit()
- func FormatAddress(addr string) string
- func FormatAddressList(addrList []string) []string
- func GMTTime(t time.Time) time.Time
- func GMTUnixTime(timestamp int64) int64
- func Get(object interface{}, keys []string) interface{}
- func IsCommonFileExtension(ext string) bool
- func IsIPv4(ip string) bool
- func IsIPv6(ip string) bool
- func IsLocalIP(ipString string) bool
- func IsWildIP(v string) bool
- func ListenReuseAddr(network string, addr string) (net.Listener, error)
- func LookupCNAME(host string) (string, error)
- func MaxInt(min1 int, min2 int) int
- func MergePorts(ports []int) [][2]int
- func MinInt(min1 int, min2 int) int
- func NewHTTPClient(timeout time.Duration) *http.Client
- func ParseAddrHost(addr string) string
- func PrintError(err error)
- func RemoveWorkspace(path string) string
- func SetRLimit(limit uint64) error
- func SetSuitableRLimit() error
- func SharedHttpClient(timeout time.Duration) *http.Client
- func SimpleDecrypt(data []byte) []byte
- func SimpleDecryptMap(base64String string) (maps.Map, error)
- func SimpleDecryptObjet(base64String string, ptr any) error
- func SimpleEncrypt(data []byte) []byte
- func SimpleEncryptMap(m maps.Map) (base64String string, err error)
- func SimpleEncryptObject(ptr any) (string, error)
- func ToValidUTF8string(v string) string
- func UnsafeBytesToString(bs []byte) string
- func UnsafeStringToBytes(s string) []byte
- func VersionToLong(version string) uint32
- type AES256CFBMethod
- type BufferPool
- type ServiceManager
- func (this *ServiceManager) Close() error
- func (this *ServiceManager) Install(exePath string, args []string) error
- func (this *ServiceManager) Log(msg string)
- func (this *ServiceManager) LogError(msg string)
- func (this *ServiceManager) PauseWindow()
- func (this *ServiceManager) Start() error
- func (this *ServiceManager) Uninstall() error
- type Ticker
- type Unzip
Constants ¶
const SO_REUSEPORT = 15
Variables ¶
var RegexpDigitNumber = regexp.MustCompile(`^\d+$`)
Functions ¶
func CopyWithFilter ¶
func CutPrefix ¶ added in v1.3.0
CutPrefix returns s without the provided leading prefix string and reports whether it found the prefix. If s doesn't start with prefix, CutPrefix returns s, false. If prefix is the empty string, CutPrefix returns s, true.
copy from go source
func DumpResponse ¶
DumpResponse 导出响应
func EqualStrings ¶ added in v0.5.8
EqualStrings 检查两个字符串slice内容是否一致
func FormatAddressList ¶
FormatAddressList format address list
func IsCommonFileExtension ¶ added in v1.3.5
IsCommonFileExtension 判断是否为常用文件扩展名 不区分大小写,且不限于是否加点符号(.)
func ListenReuseAddr ¶
ListenReuseAddr 监听可重用的端口
func MergePorts ¶ added in v0.4.10
MergePorts 聚合端口 返回 [ [fromPort, toPort], ... ]
func NewHTTPClient ¶
NewHTTPClient 获取一个新的Client
func ParseAddrHost ¶ added in v0.4.9
ParseAddrHost 分析地址中的主机名部分
func PrintError ¶
func PrintError(err error)
func RemoveWorkspace ¶
func SetSuitableRLimit ¶
func SetSuitableRLimit() error
SetSuitableRLimit set best resource limit value
func SharedHttpClient ¶
SharedHttpClient 获取一个公用的Client
func SimpleDecryptObjet ¶ added in v1.3.5
func SimpleEncryptObject ¶ added in v1.3.5
func UnsafeBytesToString ¶
UnsafeBytesToString convert bytes to string
func UnsafeStringToBytes ¶
UnsafeStringToBytes convert string to bytes
Types ¶
type AES256CFBMethod ¶
type AES256CFBMethod struct {
// contains filtered or unexported fields
}
func (*AES256CFBMethod) Decrypt ¶
func (this *AES256CFBMethod) Decrypt(dst []byte) (src []byte, err error)
func (*AES256CFBMethod) Encrypt ¶
func (this *AES256CFBMethod) Encrypt(src []byte) (dst []byte, err error)
func (*AES256CFBMethod) Init ¶
func (this *AES256CFBMethod) Init(key, iv []byte) error
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool pool for get byte slice
type ServiceManager ¶
type ServiceManager struct { Name string Description string // contains filtered or unexported fields }
ServiceManager 服务管理器
func (*ServiceManager) Install ¶
func (this *ServiceManager) Install(exePath string, args []string) error
Install 安装服务
func (*ServiceManager) PauseWindow ¶
func (this *ServiceManager) PauseWindow()
PauseWindow 保持命令行窗口是打开的