util

package
v0.0.0-...-ee45651 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathConfig = "/resources/config.json" // 配置文件路径
	PathIp     = "/resources/ip.txt"      // ip范围文件路径
)

Variables

This section is empty.

Functions

func DelayTime

func DelayTime(address string) (time.Duration, error)

DelayTime 获取延迟时间 address 格式 localhost:22 返回时间单位:毫秒ms

func GenerateTLSConfig

func GenerateTLSConfig() *tls.Config

GenerateTLSConfig 生成TLS配置

func GetCurrentAbPath

func GetCurrentAbPath() string

GetCurrentAbPath 获取项目的跟路径

func GetMacAddress

func GetMacAddress() string

GetMacAddress 读取mac地址

func GetResourcesPath

func GetResourcesPath(m string) string

GetResourcesPath 客户端获取resources文件夹目录

func GotIpRange

func GotIpRange() error

从ipRangeWebSite上爬取中国ip地址范围,并保存到本地ip.txt中

func LockProcess

func LockProcess()

func OpenBrowser

func OpenBrowser(url string) error

OpenBrowser 根据操作系统类型使用系统默认浏览器打开主页

func SettingProxy

func SettingProxy(port int, ignore string) bool

SettingProxy 设置代理 port:代理的的口号 ignore: 不走代理的地址用分号隔开 127.0.0.1;localhost;192.168.*

func ThreeExp

func ThreeExp(exp bool, a, b any) any

ThreeExp 三目运算符 exp 条件表达式

func UnlockProcess

func UnlockProcess()

UnlockProcess 释放进程单例锁

func UnsettingProxy

func UnsettingProxy() bool

UnsettingProxy 取消系统代理设置

Types

type LinuxProxySetting

type LinuxProxySetting struct{}

func (LinuxProxySetting) Setting

func (linux LinuxProxySetting) Setting(port int, ignore string) bool

func (LinuxProxySetting) Unsetting

func (linux LinuxProxySetting) Unsetting() bool

type MacProxySetting

type MacProxySetting struct{}

func (MacProxySetting) Setting

func (mac MacProxySetting) Setting(port int, ignore string) bool

func (MacProxySetting) Unsetting

func (mac MacProxySetting) Unsetting() bool

type ProxySetting

type ProxySetting interface {
	Setting(int, string) bool
	Unsetting() bool
}

type WinProxySetting

type WinProxySetting struct{}

func (WinProxySetting) Setting

func (win WinProxySetting) Setting(port int, ignore string) bool

func (WinProxySetting) Unsetting

func (win WinProxySetting) Unsetting() bool

Jump to

Keyboard shortcuts

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