myos

package
v1.11.43 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: BSD-3-Clause Imports: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindEnv

func BindEnv(name, defValue string) (bindVal string)

func Dir

func Dir(fpath string) string

func Filename

func Filename(fpath string) string

func FindFilesWithExt added in v1.11.6

func FindFilesWithExt(dir string, extension string) ([]string, error)

func FindFilesWithExtRecursive added in v1.11.6

func FindFilesWithExtRecursive(dir string, extension string) ([]string, error)

func GetDeviceIdentifier added in v1.11.24

func GetDeviceIdentifier() (string, error)

func GetFontFiles added in v1.11.20

func GetFontFiles(dir string) ([]string, error)

func GetSystemFontPath added in v1.11.20

func GetSystemFontPath() ([]string, error)

func IsExistDir

func IsExistDir(fPath string) bool

func IsExistFile

func IsExistFile(fPath string) bool

func IsExistPath

func IsExistPath(fPath string) bool

func IsExistUrlFile added in v1.11.34

func IsExistUrlFile(url string) (bool, error)

func IsLinux

func IsLinux() bool

IsLinux determines whether the system is linux.

func IsMac

func IsMac() bool

IsMac determines whether the system is darwin.

func IsSupport256Color

func IsSupport256Color() bool

IsSupport256Color checks current console whether supports 256 color.

func IsSupportColor

func IsSupportColor() bool

IsSupportColor checks current console whether supports color. Supported: linux, mac, or windows's ConEmu, Cmder, putty, git-bash.exe Not support: windows cmd.exe, powerShell.exe

func IsSupportTrueColor

func IsSupportTrueColor() bool

IsSupportTrueColor checks current console whether supports true color.

func IsWin

func IsWin() bool

IsWin determine whether the system is windows.

func Remove

func Remove(fpath string) error

func Rename

func Rename(oldPath, newPath string) error

func ResetPacProxy added in v1.11.41

func ResetPacProxy() error

func ResetSocksProxy added in v1.11.41

func ResetSocksProxy() error

func ResetWebProxy added in v1.11.41

func ResetWebProxy() error

重置 HTTP 和 HTTPS 代理

func SetPacProxy added in v1.11.41

func SetPacProxy(pacUrl string) error

func SetSocksProxy added in v1.11.41

func SetSocksProxy(server string, port int) error

func SetWebProxy added in v1.11.41

func SetWebProxy(server string, port int) error

Types

type PacProxyConfig added in v1.11.41

type PacProxyConfig struct {
	Enable bool   `json:"enable"` // 是否启用 PAC 代理
	PacURL string `json:"pacURL"` // PAC 代理地址
}

func GetPacProxy added in v1.11.41

func GetPacProxy() (*PacProxyConfig, error)

func (PacProxyConfig) ToString added in v1.11.41

func (self PacProxyConfig) ToString() string

type SocksProxyConfig added in v1.11.41

type SocksProxyConfig struct {
	Server string `json:"server"` // 服务器地址 (如 127.0.0.1)
	Port   int    `json:"port"`   // 端口号 (如 1080)
	Enable bool   `json:"enable"`
}

func GetSocksProxyInfo added in v1.11.41

func GetSocksProxyInfo() (*SocksProxyConfig, error)

func (SocksProxyConfig) ToString added in v1.11.41

func (self SocksProxyConfig) ToString() string

type WebProxyConfig added in v1.11.41

type WebProxyConfig struct {
	Server string `json:"server"` // 服务器地址 (如 127.0.0.1)
	Port   int    `json:"port"`   // 端口号 (如 1080)
	Enable bool   `json:"enable"`
}

func GetWebProxyInfo added in v1.11.41

func GetWebProxyInfo() (*WebProxyConfig, error)

func (WebProxyConfig) ToString added in v1.11.41

func (self WebProxyConfig) ToString() string

Jump to

Keyboard shortcuts

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