gaihosts

package module
v0.0.0-...-9eb6559 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

gaihosts

找到我

Documentation

Index

Constants

View Source
const (
	ConfigDir = "gaihosts"
	ConfigExt = ".buguai"
)

配置 hosts 的文件信息

Variables

View Source
var (
	ErrNoHostsFile   = "no hosts file : %s"
	ErrHostsIsFolder = "the hosts file cannot be a folder : %s"
)

Functions

func GetConfigFilesName

func GetConfigFilesName() ([]string, map[string]string, error)

GetConfigFilesName 获取配置信息文件夹中的配置文件

func GetConfigHostDir

func GetConfigHostDir() string

func GetFileBody

func GetFileBody(fileName string) ([]byte, string, error)

GetFileBody 获取文件的内容

func GetHostFileDir

func GetHostFileDir() string

func GetHostFilePath

func GetHostFilePath() string

func GetHostPath

func GetHostPath() (fileDir, filePath string)

GetHostPath linux 下的 hosts 的路径

func GetHostsFileByte

func GetHostsFileByte() (res []byte, err error)

GetHostsFileByte 获取文件中的内容

func IsRoot

func IsRoot() bool

IsRoot 是否是 管理员

func SaveHostFile

func SaveHostFile(fileName string, body []byte) error

SaveHostFile 保存配置 文件

func SetHostsFileByte

func SetHostsFileByte(body []byte) (err error)

SetHostsFileByte 获取文件中的内容

Types

This section is empty.

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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