Documentation ¶
Index ¶
- Variables
- func CreateConfigFile(configFile string, reWrite bool)
- func InstallGolangBasedProgram(configTree *toml.Tree)
- func InstallSelfProgram(configTree *toml.Tree)
- func InstallShellBasedProgram(configTree *toml.Tree)
- func PrintConfigFile(configFile string)
- func PrintVersionInfo(only bool)
- func ProgramConfigurator(flags map[string]bool)
- func UninstallGolangBasedProgram(configTree *toml.Tree)
- func UninstallSelfProgram(configTree *toml.Tree)
- func UninstallShellBasedProgram(configTree *toml.Tree)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // chezmoi 的依赖项 ChezmoiDependencies = "/usr/bin/chezmoi" ChezmoiConfig = color.Sprintf(chezmoiConfigFormat, chezmoiSourceDir, sep, chezmoiAutoCommit, sep, chezmoiAutoPush) ChezmoiConfigFile = filepath.Join(home, ".config", "chezmoi", "chezmoi.toml") // cobra 的依赖项 CobraDependencies = filepath.Join(golangGOBIN, "cobra-cli") CobraConfig = color.Sprintf(cobraConfigFormat, cobraAuthor, email, cobraLicense, cobraUseViper) CobraConfigFile = filepath.Join(home, ".cobra.yaml") // docker service 和 mirrors 的依赖项 DockerDependencies = "/usr/bin/dockerd" DockerServiceConfig = color.Sprintf(dockerServiceConfigFormat, dockerServiceExecStart, dockerServiceDataRoot) DockerServiceConfigFile = "/etc/systemd/system/docker.service.d/override.conf" DockerMirrorsConfig = color.Sprintf(dockerMirrorsConfigFormat, sep, dockerMirrorsRegistryMirrors) DockerMirrorsConfigFile = "/etc/docker/daemon.json" // frpc 的依赖项 FrpcDependencies = "/usr/bin/frpc" FrpcConfig = color.Sprintf(frpcConfigFormat, frpcRestart) FrpcConfigFile = "/etc/systemd/system/frpc.service.d/override.conf" // git 的依赖项 GitDependencies = "/usr/bin/git" GitConfig = color.Sprintf(gitConfigFormat, sep, hostname, sep, email, sep, gitCoreEditor, sep, gitCoreAutoCRLF, sep, gitMergeTool, sep, gitColorUI, sep, gitPullRebase, sep, gitFilterLfsClean, sep, gitFilterLfsSmudge, sep, gitFilterLfsProcess, sep, gitFilterLfsRequired) GitConfigFile = filepath.Join(home, ".gitconfig") // go 的依赖项 GolangDependencies = "/usr/bin/go" GolangConfig = color.Sprintf(golangConfigFormat, golangGO111MODULE, golangGOBIN, golangGOPATH, golangGOCACHE, golangGOMODCACHE) GolangConfigFile = filepath.Join(home, ".config", "go", "env") // pip 的依赖项 PipDependencies = "/usr/bin/pip" PipConfig = color.Sprintf(pipConfigFormat, pipIndexUrl, pipTrustedHost) PipConfigFile = filepath.Join(home, ".config", "pip", "pip.conf") // system-checkupdates timer 和 service 的依赖项 SystemCheckupdatesDependencies = "/usr/local/bin/system-checkupdates" // >= 3.0.0-20230313.1 SystemCheckupdatesTimerConfig = color.Sprintf(systemCheckupdatesTimerConfigFormat, systemcheckupdatesTimerDescription, systemcheckupdatesTimerOnBootSec, systemcheckupdatesTimerOnUnitInactiveSec, systemcheckupdatesTimerAccuracySec, systemcheckupdatesTimerPersistent, systemcheckupdatesTimerWantedBy) SystemCheckupdatesTimerConfigFile = "/etc/systemd/system/system-checkupdates.timer" SystemCheckupdatesServiceConfig = color.Sprintf(systemCheckupdatesServiceConfigFormat, systemcheckupdatesServiceDescription, systemcheckupdatesServiceAfter, systemcheckupdatesServiceWants, systemcheckupdatesServiceType, systemcheckupdatesServiceExecStart) SystemCheckupdatesServiceConfigFile = "/etc/systemd/system/system-checkupdates.service" )
Functions ¶
func CreateConfigFile ¶ added in v1.4.4
CreateConfigFile 创建配置文件
参数:
- configFile: 配置文件路径
- reWrite: 是否覆写
func InstallGolangBasedProgram ¶ added in v1.4.0
func InstallGolangBasedProgram(configTree *toml.Tree)
InstallGolangBasedProgram 安装/更新基于 Golang 的程序
参数:
- configTree: 解析 toml 配置文件得到的配置树
func InstallSelfProgram ¶ added in v1.4.0
func InstallSelfProgram(configTree *toml.Tree)
InstallSelfProgram 安装/更新管理程序本身
参数:
- configTree: 解析 toml 配置文件得到的配置树
func InstallShellBasedProgram ¶ added in v1.4.0
func InstallShellBasedProgram(configTree *toml.Tree)
InstallShellBasedProgram 安装/更新基于 Shell 的程序
参数:
- configTree: 解析 toml 配置文件得到的配置树
func PrintConfigFile ¶ added in v1.4.4
func PrintConfigFile(configFile string)
PrintConfigFile 打印配置文件内容
参数:
- configFile: 配置文件路径
func PrintVersionInfo ¶ added in v1.4.4
func PrintVersionInfo(only bool)
PrintVersionInfo 打印版本信息
参数:
- only: 是否只打印版本号
func UninstallGolangBasedProgram ¶ added in v1.7.0
func UninstallGolangBasedProgram(configTree *toml.Tree)
UninstallGolangBasedProgram 卸载基于 Golang 的程序
参数:
- configTree: 解析 toml 配置文件得到的配置树
func UninstallSelfProgram ¶ added in v1.7.0
func UninstallSelfProgram(configTree *toml.Tree)
UninstallSelfProgram 卸载管理程序本身
参数:
- configTree: 解析 toml 配置文件得到的配置树
func UninstallShellBasedProgram ¶ added in v1.7.0
func UninstallShellBasedProgram(configTree *toml.Tree)
UninstallShellBasedProgram 卸载基于 Shell 的程序
参数:
- configTree: 解析 toml 配置文件得到的配置树
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.