Documentation
¶
Index ¶
- Variables
- func CloneRepoViaHTTP(path string, url string, repo string) error
- func CompareFile(file1Path string, file2Path string) (bool, error)
- func CreateDir(dirPath string) error
- func CreateFile(filePath string) error
- func DeleteFile(filePath string) error
- func DownloadFile(url string, urlFile string, outputFile string) (string, error)
- func FileEmpty(filePath string) bool
- func FileExist(filePath string) bool
- func GetHostname() string
- func GetTomlConfig(filePath string) (*toml.Tree, error)
- func GetUserInfo(uid int) (*user.User, error)
- func GetVariable(key string) string
- func GoToDir(dirPath string) error
- func InstallFile(sourceFile, targetFile string) error
- func ParseApiResponse(body []byte) (string, error)
- func PolicyKitAuthentication()
- func ProgramInfo(only bool) string
- func RequestApi(url string) ([]byte, error)
- func RunCommandGetFlag(command string, args []string) bool
- func RunCommandGetResult(command string, args []string) (string, error)
- func SetVariable(key, value string) error
- func WriteFile(filePath string, content string) error
- func WriteTomlConfig(filePath string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // pip配置文件内容 PipConfig = "[global]\nindex-url = http://mirrors.aliyun.com/pypi/simple\ntrusted-host = mirrors.aliyun.com" PipConfigFile = varHome + "/.config/pip/pip.conf" // npm配置文件内容 NpmConfig = "registry=https://registry.npm.taobao.org" NpmConfigFile = varHome + "/.npmrc" // docker配置文件内容 DockerConfig = "[Service]\nExecStart=\nExecStart=/usr/bin/dockerd --data-root=" + varHome + "/Documents/Docker/Root -H fd://" DockerConfigFile = "/etc/systemd/system/docker.service.d/override.conf" GitConfig = fmt.Sprintf(format, sep, gitUserName, sep, gitUserEmail, sep, gitCoreEditor, sep, gitCoreAutoCRLF, sep, gitMergeTool, sep, gitColorUI, sep, gitPullRebase, sep, gitFilterLfsClean, sep, gitFilterLfsSmudge, sep, gitFilterLfsProcess, sep, gitFilterLfsRequired) GitConfigFile = varHome + "/.gitconfig" )
Functions ¶
func CloneRepoViaHTTP ¶ added in v0.1.2
通过HTTP协议克隆仓库
func CompareFile ¶ added in v0.1.0
并发比较两个文件是否相同
func DownloadFile ¶ added in v0.3.0
通过HTTP协议下载文件
func GetTomlConfig ¶ added in v0.0.4
读取toml配置文件
func InstallFile ¶ added in v0.1.0
复制文件,如果文件存在则覆盖
func ParseApiResponse ¶ added in v0.2.9
解析API响应体,根据JSON数据解析后的类型选择数据提取方式
func PolicyKitAuthentication ¶ added in v0.1.0
func PolicyKitAuthentication()
func ProgramInfo ¶
func RunCommandGetFlag ¶ added in v0.0.5
运行指定命令并获取标志位
func RunCommandGetResult ¶ added in v0.0.5
运行指定命令并获取命令输出
func WriteTomlConfig ¶ added in v0.0.4
写入toml配置文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.