general

package
v1.12.9 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name    string = "Manager"                 // 程序名
	Version string = "v1.12.9"                 // 程序版本
	Project string = "github.com/yhyj/manager" // 项目地址
)

Variables

View Source
var (
	FgBlackText        = color.FgBlack.Render        // 前景色 - 黑色
	FgWhiteText        = color.FgWhite.Render        // 前景色 - 白色
	FgLightWhiteText   = color.FgLightWhite.Render   // 前景色 - 亮白色
	FgGrayText         = color.FgGray.Render         // 前景色 - 灰色
	FgRedText          = color.FgRed.Render          // 前景色 - 红色
	FgLightRedText     = color.FgLightRed.Render     // 前景色 - 亮红色
	FgGreenText        = color.FgGreen.Render        // 前景色 - 绿色
	FgLightGreenText   = color.FgLightGreen.Render   // 前景色 - 亮绿色
	FgYellowText       = color.FgYellow.Render       // 前景色 - 黄色
	FgLightYellowText  = color.FgLightYellow.Render  // 前景色 - 亮黄色
	FgBlueText         = color.FgBlue.Render         // 前景色 - 蓝色
	FgLightBlueText    = color.FgLightBlue.Render    // 前景色 - 亮蓝色
	FgMagentaText      = color.FgMagenta.Render      // 前景色 - 品红
	FgLightMagentaText = color.FgLightMagenta.Render // 前景色 - 亮品红
	FgCyanText         = color.FgCyan.Render         // 前景色 - 青色
	FgLightCyanText    = color.FgLightCyan.Render    // 前景色 - 亮青色

	BgBlackText        = color.BgBlack.Render        // 背景色 - 黑色
	BgWhiteText        = color.BgWhite.Render        // 背景色 - 白色
	BgLightWhiteText   = color.BgLightWhite.Render   // 背景色 - 亮白色
	BgGrayText         = color.BgGray.Render         // 背景色 - 灰色
	BgRedText          = color.BgRed.Render          // 背景色 - 红色
	BgLightRedText     = color.BgLightRed.Render     // 背景色 - 亮红色
	BgGreenText        = color.BgGreen.Render        // 背景色 - 绿色
	BgLightGreenText   = color.BgLightGreen.Render   // 背景色 - 亮绿色
	BgYellowText       = color.BgYellow.Render       // 背景色 - 黄色
	BgLightYellowText  = color.BgLightYellow.Render  // 背景色 - 亮黄色
	BgBlueText         = color.BgBlue.Render         // 背景色 - 蓝色
	BgLightBlueText    = color.BgLightBlue.Render    // 背景色 - 亮蓝色
	BgMagentaText      = color.BgMagenta.Render      // 背景色 - 品红
	BgLightMagentaText = color.BgLightMagenta.Render // 背景色 - 亮品红
	BgCyanText         = color.BgCyan.Render         // 背景色 - 青色
	BgLightCyanText    = color.BgLightCyan.Render    // 背景色 - 亮青色

	InfoText      = color.Info.Render      // Info 文本
	NoteText      = color.Note.Render      // Note 文本
	LightText     = color.Light.Render     // Light 文本
	ErrorText     = color.Error.Render     // Error 文本
	DangerText    = color.Danger.Render    // Danger 文本
	NoticeText    = color.Notice.Render    // Notice 文本
	SuccessText   = color.Success.Render   // Success 文本
	CommentText   = color.Comment.Render   // Comment 文本
	PrimaryText   = color.Primary.Render   // Primary 文本
	WarnText      = color.Warn.Render      // Warn 文本
	QuestionText  = color.Question.Render  // Question 文本
	SecondaryText = color.Secondary.Render // Secondary 文本
)
View Source
var (
	DownloadFlag = "📥"  // 运行状态符号 - 下载中
	LatestFlag   = "🎉"  // 运行状态符号 - 已是最新
	SuccessFlag  = "✅"  // 运行状态符号 - 成功
	WarningFlag  = "⚠️" // 运行状态符号 - 警告
	ErrorFlag    = "❌"  // 运行状态符号 - 失败
)
View Source
var (
	NiceFlag = "\u25CF" // 标识符号 - 代表已实现
	MeanFlag = "\u25CB" // 标识符号 - 代表未实现
)
View Source
var (
	CursorOnFlag   = "👉"  // 选择器符号 - 光标所在
	CursorOffFlag  = "  " // 选择器符号 - 光标不在
	SelectedFlag   = "•"  // 选择器符号 - 已选中
	UnselectedFlag = " "  // 选择器符号 - 已选中
	SelectAllFlag  = "⭐️" // 选择器符号 - 全选
)
View Source
var (
	SeparatorBaseLength = 50    // 分隔符基础长度
	Separator1st        = "="   // 分隔符 - 1级
	Separator2st        = "-"   // 分隔符 - 2级
	Separator3st        = "·"   // 分隔符 - 3级
	Indicator           = "-->" // 分隔符 - 指示器
)
View Source
var (
	LatestVersionMessage       = "is already the latest version"                   // 输出文本 - 已安装的程序和脚本为最新版
	UnableToCompileMessage     = "Makefile or main.go file does not exist"         // 输出文本 - 缺失编译文件无法完成编译
	AcsInstallSuccessMessage   = "auto-completion script installed successfully"   // 输出文本 - 自动补全脚本安装成功
	AcsInstallFailedMessage    = "auto-completion script installation failed"      // 输出文本 - 自动补全脚本安装失败
	AcsUninstallSuccessMessage = "auto-completion script uninstalled successfully" // 输出文本 - 自动补全脚本卸载成功
	AcsUninstallFailedMessage  = "auto-completion script uninstallation failed"    // 输出文本 - 自动补全脚本卸载失败
)
View Source
var (
	GoLatestReleaseTagApiFormat      = "%s/repos/%s/%s/releases/latest" // API 和下载地址 - 请求远端仓库最新 Tag 的 API - Release
	GoLatestSourceTagApiFormat       = "%s/repos/%s/%s/tags"            // API 和下载地址 - 请求远端仓库最新 Tag 的 API - Source
	ShellLatestHashApiFormat         = "%s/repos/%s/%s/contents/%s/%s"  // API 和下载地址 - 请求远端仓库最新脚本的 Hash 值的 API
	ShellGithubBaseDownloadUrlFormat = "%s/%s/%s/%s"                    // API 和下载地址 - 远端仓库脚本基础下载地址(不包括在仓库路中的路径) - GitHub 格式
	ShellGiteaBaseDownloadUrlFormat  = "%s/%s/%s/raw/branch/%s"         // API 和下载地址 - 远端仓库脚本基础下载地址(不包括在仓库路中的路径) - Gitea 格式
)
View Source
var (
	MultiSelectTips     = "Please select from the following %s (multi-select)\n"                                    // 提示词 - 多选
	SingleSelectTips    = "Please select from the following %s (single-select)\n"                                   // 提示词 - 单选
	KeyTips             = "Press '%s' to select, '%s' to run, '%s' to quit\n"                                       // 提示词 - 按键
	SelectOneTips       = "Select %s"                                                                               // 提示词 - 单选
	SelectAllTips       = "Select All"                                                                              // 提示词 - 全选
	UninstallTips       = "Do you want to uninstall '%s'?"                                                          // 提示词 - 卸载软件
	OverWriteTips       = "%s file already exists, do you want to overwrite it?"                                    // 提示词 - 文件已存在是否覆写
	InstallTips         = "Please install %s first"                                                                 // 提示词 - 需要安装
	InputTips           = "Please input '%s' value"                                                                 // 提示词 - 输入
	RestartServiceTips  = "Service '%s' modified, restart it?"                                                      // 提示词 - 重启服务
	EnableServiceTips   = "Service '%s' disabled, enable it?"                                                       // 提示词 - 启用服务
	NotFoundServiceTips = "Not find the '%s' service, please check /etc/systemd/system and /usr/lib/systemd/system" // 提示词 - 未找到服务
)
View Source
var (
	ChezmoiDependencies = "chezmoi"                                                 // 主程序
	ChezmoiConfigFile   = filepath.Join(home, ".config", "chezmoi", "chezmoi.toml") // 配置文件

)

Chezmoi

View Source
var (
	// cobra 的依赖
	CobraDependencies = "cobra-cli"                        // 主程序
	CobraConfigFile   = filepath.Join(home, ".cobra.yaml") // 配置文件

)

Cobra

View Source
var (
	// docker 的依赖
	DockerDependencies      = "dockerd"                                            // 主程序
	DockerServiceConfigFile = "/etc/systemd/system/docker.service.d/override.conf" // 配置文件

)

Docker

View Source
var (
	// frpc 的依赖
	FrpcDependencies = "frpc"                                             // 主程序
	FrpcConfigFile   = "/etc/systemd/system/frpc.service.d/override.conf" // 配置文件

)

Frpc

View Source
var (
	// git 的依赖
	GitDependencies = "git"                             // 主程序
	GitConfigFile   = filepath.Join(home, ".gitconfig") // 配置文件

)

Git

View Source
var (
	// go 的依赖
	GolangDependencies = "go"                                        // 主程序
	GolangConfigFile   = filepath.Join(home, ".config", "go", "env") // 配置文件

)

Golang

View Source
var (
	// pip 的依赖
	PipDependencies = "pip"                                             // 主程序
	PipConfigFile   = filepath.Join(home, ".config", "pip", "pip.conf") // 配置文件

)

Pip

View Source
var (
	AllInstallMethod          = []string{"release", "source"}               // 所有安装方式,可选 source 或 release
	DefaultInstallMethodIndex = 0                                           // 默认安装方式的下标(从0开始)
	InstallMethod             = AllInstallMethod[DefaultInstallMethodIndex] // 默认安装方式
)
View Source
var (
	HttpProxy  = "http://127.0.0.1:8080" // 默认 HTTP 代理
	HttpsProxy = HttpProxy               // 默认 HTTPS 代理,与 HTTP 代理一致
)
View Source
var (
	GitCommitHash string = "Unknown" // Git 提交 Hash
	BuildTime     string = "Unknown" // 编译时间
	BuildBy       string = "Unknown" // 编译者
)
View Source
var Arch = runtime.GOARCH // 系统架构
View Source
var (
	ConfigFile = filepath.Join(configDir, programDir, configFile) // 配置文件路径
)
View Source
var DelayTime float32 = 0.01

默认延时

View Source
var (
	ErrorInfoFlag = "•" // 身份符号 - 报错信息
)
View Source
var Language = GetLanguage() // 系统语言
View Source
var Notifier []string // 通知器
View Source
var Platform = runtime.GOOS // 操作系统
View Source
var ProgressParameters = map[string]string{
	"view": "0",
}

进度条变量

View Source
var Sep = string(filepath.Separator) // 路径分隔符
View Source
var (
	// update-checker Timer 和 Service 的依赖
	UpdateCheckerDependencies = "checker" // 主程序,需要版本 >= v0.7.0

)

UpdateChecker

View Source
var UserInfo, _ = GetUserInfoByName(UserName) // 用户信息
View Source
var UserName = func() string {
	if GetVariable("SUDO_USER") != "" {
		return GetVariable("SUDO_USER")
	}
	return GetVariable("USER")
}()

用户名,当程序提权运行时,使用 SUDO_USER 变量获取提权前的用户名

Functions

func AreYouSure added in v1.12.6

func AreYouSure(question string, defaultAnswer bool) (bool, error)

AreYouSure 获取用户二次确认

参数:

  • question: 问题
  • defaultAnswer: 默认回答,true 或 false

返回:

  • true/false
  • 错误信息

func CloneRepoViaHTTP added in v1.5.0

func CloneRepoViaHTTP(path string, url string, repo string) error

CloneRepoViaHTTP 通过 HTTP 协议克隆仓库

参数:

返回:

  • 错误信息

func CompareFile

func CompareFile(file1Path string, file2Path string) (bool, error)

CompareFile 并发比较两个文件是否相同

参数:

  • file1Path: 文件1路径
  • file2Path: 文件2路径

返回:

  • 文件相同返回 true,出错或不同返回 false

func CreateDir

func CreateDir(dir string) error

CreateDir 创建文件夹

参数:

  • dir: 文件夹路径

返回:

  • 错误信息

func CreateFile

func CreateFile(file string) error

CreateFile 创建文件,包括其父目录

参数:

  • file: 文件路径

返回:

  • 错误信息

func Delay added in v1.0.8

func Delay(second float32)

Delay 延时

参数:

  • second: 延时秒数

func DeleteFile

func DeleteFile(filePath string) error

DeleteFile 删除文件,如果目标是文件夹则包括其下所有文件

参数:

  • filePath: 文件路径

返回:

  • 错误信息

func DownloadFile added in v1.5.0

func DownloadFile(url string, outputFile string, progressParameters map[string]string) error

DownloadFile 通过 HTTP 协议下载文件

参数:

  • url: 文件下载地址
  • outputFile: 下载文件保存路径
  • progressParameters: 进度条参数

返回:

  • 错误信息

func EmptyFile added in v1.7.0

func EmptyFile(file string) error

EmptyFile 清空文件内容,文件不存在则创建

参数:

  • file: 文件路径

返回:

  • 错误信息

func FileExist

func FileExist(filePath string) bool

FileExist 判断文件是否存在

参数:

  • filePath: 文件路径

返回:

  • 文件存在返回 true,否则返回 false

func FileSHA256 added in v1.0.4

func FileSHA256(filePath string) (string, error)

FileSHA256 计算文件的 SHA-256 校验和

参数:

  • filePath: 待校验文件

返回:

  • 校验和
  • 错误信息

func FileVerification added in v1.5.0

func FileVerification(checksumFile, filePath string) (bool, error)

FileVerification 使用校验和文件校验文件的完整性

参数:

  • checksumFile: 校验和文件
  • filePath: 待校验文件

返回:

  • 校验结果
  • 错误信息

func GetCallerInfo added in v1.9.9

func GetCallerInfo() (string, int)

GetCallerInfo 获取调用者信息

返回:

  • 调用者所在文件名(不带后缀)
  • 调用者所在行号

func GetCurrentUserInfo

func GetCurrentUserInfo() (*user.User, error)

GetCurrentUserInfo 获取当前用户信息

返回:

  • 用户信息
  • 错误信息

func GetHostname

func GetHostname() string

GetHostname 获取系统 HOSTNAME

返回:

  • HOSTNAME 或空字符串

func GetLanguage added in v1.8.4

func GetLanguage() string

GetLanguage 获取系统语言

返回:

  • 系统语言,目前仅支持 zh 或 en

func GetLatestReleaseTag added in v1.0.4

func GetLatestReleaseTag(body []byte) (string, error)

GetLatestReleaseTag 解析 API 响应体,获取 Release 的最新 Tag

参数:

  • body: API 响应数据

返回:

  • 最新 Release 的 Tag
  • 错误信息

func GetLatestSourceHash added in v1.0.4

func GetLatestSourceHash(body []byte) (string, error)

GetLatestSourceHash 解析 API 响应体,获取源代码的最新提交的 Hash

参数:

  • body: API 响应数据

返回:

  • 最新提交的 Hash
  • 错误信息

func GetLatestSourceTag added in v1.0.4

func GetLatestSourceTag(body []byte) (string, error)

GetLatestSourceTag 解析 API 响应数据,获取源代码的最新 Tag

参数:

  • body: API 响应数据

返回:

  • 最新 Tag
  • 错误信息

func GetReleaseFileInfo added in v1.0.4

func GetReleaseFileInfo(body []byte, fileName FileName) (multipleFilesInfo, error)

GetReleaseFileInfo 解析 API 响应体,获取 Release 文件的信息

参数:

  • body: API 响应数据
  • fileName: 要获取其信息的文件名

返回:

  • 多文件信息(包括文件名 Name 、文件大小 Size 、文件类型 ContentType 、下载链接 DownloadUrl 和下载次数 DownloadCount)
  • 错误信息

func GetTomlConfig added in v1.4.4

func GetTomlConfig(filePath string) (*toml.Tree, error)

GetTomlConfig 读取 toml 配置文件

参数:

  • filePath: toml 配置文件路径

返回:

  • toml 配置树
  • 错误信息

func GetUrlHost added in v1.9.0

func GetUrlHost(rawURL string) (string, error)

GetUrlHost 解析 URL ,获取其主机名

参数:

  • rawURL: 待解析的 URL

返回:

  • URL 中的主机名
  • 错误信息

func GetUserInfoById

func GetUserInfoById(userId int) (*user.User, error)

GetUserInfoById 根据 ID 获取用户信息

参数:

  • userId: 用户 ID

返回:

  • 用户信息
  • 错误信息

func GetUserInfoByName

func GetUserInfoByName(userName string) (*user.User, error)

GetUserInfoByName 根据用户名获取用户信息

参数:

  • userName: 用户名

返回:

  • 用户信息
  • 错误信息

func GetUserInput added in v1.12.6

func GetUserInput(tips string, defaultValue string) (string, error)

GetUserInput 获取用户输入

参数:

  • tips: 提示信息
  • defaultValue: 用户未输入时的默认值

返回:

  • 用户输入(去掉了最后的换行符)
  • 错误信息

func GetUserName added in v1.9.3

func GetUserName() (string, error)

GetUserName 获取用户真实/显示名称,可能为空

返回:

  • 用户名称
  • 错误信息

func GetVariable

func GetVariable(key string) string

GetVariable 获取环境变量

参数:

  • key: 变量名

返回:

  • 变量值

func GiveYourChoice added in v1.12.6

func GiveYourChoice(tips string, options []string, defaultOption int) (string, error)

GiveYourChoice 给出可选项,获取用户选择

参数:

  • tips: 提示信息
  • options: 可选项
  • defaultOption: 默认选项的下标(从0开始)

返回:

  • 用户的选择(去掉了首尾空格和最后的换行符)
  • 错误信息

func GoToDir

func GoToDir(dirPath string) error

GoToDir 进到指定文件夹

参数:

  • dirPath: 文件夹路径

返回:

  • 错误信息

func InitPocketFile added in v1.7.0

func InitPocketFile(pocketFile string) error

InitPocketFile 初始化记账文件

参数:

  • pocketFile: 记账文件路径

返回:

  • 错误信息

func Install added in v1.7.0

func Install(sourceFile, targetFile string, perm os.FileMode) error

Install 安装,覆盖已存在的同名文件

参数:

  • sourceFile: 源文件路径
  • targetFile: 目标文件路径
  • perm: 目标文件权限

返回:

  • 错误信息

func ListFolderFiles added in v1.1.2

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

ListFolderFiles 列出指定文件夹下的所有文件

参数:

  • dir: 文件夹路径

返回:

  • 文件列表
  • 错误信息

func MultipleSelectionFilter added in v1.5.0

func MultipleSelectionFilter(choices, highlights []string, negatives string) ([]string, error)

MultipleSelectionFilter 多选筛选器,接受一个可选项切片,返回一个已选项切片,允许全选

参数:

  • choices: 可选项
  • highlights: 高亮项
  • negatives: 希望选择器在运行后输出的信息

返回:

  • 已选项
  • 错误信息

func Notification added in v1.10.1

func Notification()

Notification 显示通知

func PrintDelimiter added in v1.0.8

func PrintDelimiter(length int)

PrintDelimiter 打印分隔符

参数:

  • length: 分隔符长度

func ProgramInfo

func ProgramInfo() map[string]string

ProgramInfo 返回程序信息

返回:

  • 程序信息

func ReadFile added in v1.7.0

func ReadFile(file string) ([]string, error)

ReadFile 依次读取文件每行内容

参数:

  • file: 文件路径

返回:

  • 指定行的内容

func RealLength added in v1.0.8

func RealLength(text string) int

RealLength 去除控制字符和图标的附加字符,获取文本实际长度

参数:

  • text: 文本

返回:

  • 实际长度

func RequestApi

func RequestApi(url string) ([]byte, error)

RequestApi 请求 API ,返回响应数据

参数:

  • url: API 地址

返回:

  • 响应数据
  • 错误信息

func RunCommandToBuffer added in v1.11.5

func RunCommandToBuffer(command string, args []string) (string, string, error)

RunCommandToBuffer 运行命令,将命令的 Stdout 和 Stderr 定向到字节缓冲区

  • 命令的 Stdout 和 Stderr 末尾自带的换行符已去除

参数:

  • command: 命令
  • args: 命令参数(每个以空格分隔的参数作为切片的一个元素)

返回:

  • Stdout 缓冲区内容
  • Stderr 缓冲区内容
  • 错误信息

func RunCommandToOS added in v1.11.5

func RunCommandToOS(command string, args []string) error

RunCommandToOS 运行命令,将命令的 Stdin, Stdout 和 Stderr 定向到系统标准输入、标准输出和标准错误

参数:

  • command: 命令
  • args: 命令参数(每个以空格分隔的参数作为切片的一个元素)

返回:

  • 错误信息

func SetVariable

func SetVariable(key, value string) error

SetVariable 设置环境变量

参数:

  • key: 变量名
  • value: 变量值

返回:

  • 错误信息

func SetupChezmoi added in v1.12.1

func SetupChezmoi()

SetupChezmoi 配置 Chezmoi

func SetupCobra added in v1.12.1

func SetupCobra()

SetupCobra 配置 Cobra

func SetupDocker added in v1.12.1

func SetupDocker()

SetupDocker 配置 Docker

func SetupFrpc added in v1.12.1

func SetupFrpc()

SetupFrpc 配置 Frpc

func SetupGit added in v1.12.1

func SetupGit()

SetupGit 配置 Git

func SetupGolang added in v1.12.1

func SetupGolang()

SetupGolang 配置 Golang

func SetupPip added in v1.12.1

func SetupPip()

SetupPip 配置 Pip

func SetupUpdateChecker added in v1.12.1

func SetupUpdateChecker()

SetupUpdateChecker 配置 UpdateChecker

func Uninstall added in v1.7.0

func Uninstall(targetFile string) error

Uninstall 卸载文件,自动检测文件是否存在

参数:

  • targetFile: 目标文件路径

返回:

  • 错误信息

func UnzipFile added in v1.0.4

func UnzipFile(filePath, outputDir string) error

UnzipFile 检测压缩文件类型,执行相应的解压函数

参数:

  • filePath: 待解压文件
  • outputDir: 解压文件的存储目录

返回:

  • 错误信息

func UpperFirstChar added in v1.10.9

func UpperFirstChar(str string) string

UpperFirstChar 最大化字符串的第一个字母

参数:

  • str: 需要处理的字符串

返回:

  • 处理后的字符串

func WriteFile

func WriteFile(filePath, content, mode string) error

WriteFile 写入内容到文件,文件不存在则创建,不自动换行

参数:

  • filePath: 文件路径
  • content: 内容
  • mode: 写入模式,追加('a', O_APPEND, 默认)或覆盖('t', O_TRUNC)

返回:

  • 错误信息

func WriteFileWithNewLine added in v1.7.0

func WriteFileWithNewLine(filePath, content, mode string) error

WriteFileWithNewLine 写入内容到文件,文件不存在则创建,自动换行

参数:

  • filePath: 文件路径
  • content: 写入内容
  • mode: 写入模式,追加('a', O_APPEND, 默认)或覆盖('t', O_TRUNC)

返回:

  • 错误信息

func WriteTomlConfig added in v1.4.4

func WriteTomlConfig(filePath string) (int64, error)

WriteTomlConfig 写入 toml 配置文件

参数:

  • filePath: toml 配置文件路径

返回:

  • 写入的字节数
  • 错误信息

Types

type Config added in v1.4.4

type Config struct {
	Program  ProgramConfig  `toml:"program"`
	Variable VariableConfig `toml:"variable"`
}

用于转换 Toml 配置树的结构体

func LoadConfigToStruct added in v1.4.4

func LoadConfigToStruct(configTree *toml.Tree) (*Config, error)

LoadConfigToStruct 将 Toml 配置树加载到结构体

参数:

  • configTree: 解析 toml 配置文件得到的配置树

返回:

  • 结构体
  • 错误信息

type FileName added in v1.0.4

type FileName struct {
	ChecksumsFile string `json:"checksums"`
	ArchiveFile   string `json:"archive"`
}

要获取其信息的文件名

type GoConfig added in v1.4.4

type GoConfig struct {
	Names          []string `toml:"names"`
	ReleaseApi     string   `toml:"release_api"`
	ReleaseAccept  string   `toml:"release_accept"`
	GeneratePath   string   `toml:"generate_path"`
	GithubUrl      string   `toml:"github_url"`
	GithubApi      string   `toml:"github_api"`
	GithubUsername string   `toml:"github_username"`
	GiteaUrl       string   `toml:"gitea_url"`
	GiteaApi       string   `toml:"gitea_api"`
	GiteaUsername  string   `toml:"gitea_username"`
	CompletionDir  []string `toml:"completion_dir"`
}

type ProgramConfig added in v1.7.0

type ProgramConfig struct {
	Method        string      `toml:"method"`
	ProgramPath   string      `toml:"program_path"`
	ResourcesPath string      `toml:"resources_path"`
	ReleaseTemp   string      `toml:"release_temp"`
	SourceTemp    string      `toml:"source_temp"`
	PocketPath    string      `toml:"pocket_path"`
	PocketFile    string      `toml:"pocket_file"`
	Self          SelfConfig  `toml:"self"`
	Go            GoConfig    `toml:"go"`
	Shell         ShellConfig `toml:"shell"`
}

type SelfConfig added in v1.4.4

type SelfConfig struct {
	Name           string   `toml:"name"`
	ReleaseApi     string   `toml:"release_api"`
	ReleaseAccept  string   `toml:"release_accept"`
	GeneratePath   string   `toml:"generate_path"`
	GithubUrl      string   `toml:"github_url"`
	GithubApi      string   `toml:"github_api"`
	GithubUsername string   `toml:"github_username"`
	GiteaUrl       string   `toml:"gitea_url"`
	GiteaApi       string   `toml:"gitea_api"`
	GiteaUsername  string   `toml:"gitea_username"`
	CompletionDir  []string `toml:"completion_dir"`
}

type ShellConfig added in v1.4.4

type ShellConfig struct {
	Names          []string `toml:"names"`
	Repo           string   `toml:"repo"`
	Dir            string   `toml:"dir"`
	GithubApi      string   `toml:"github_api"`
	GithubRaw      string   `toml:"github_raw"`
	GithubUsername string   `toml:"github_username"`
	GithubBranch   string   `toml:"github_branch"`
	GiteaApi       string   `toml:"gitea_api"`
	GiteaRaw       string   `toml:"gitea_raw"`
	GiteaUsername  string   `toml:"gitea_username"`
	GiteaBranch    string   `toml:"gitea_branch"`
}

type VariableConfig added in v1.4.4

type VariableConfig struct {
	HTTPProxy  string `toml:"http_proxy"`
	HTTPSProxy string `toml:"https_proxy"`
}

Jump to

Keyboard shortcuts

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