Documentation ¶
Index ¶
- func BackFile(path string) error
- func CopyConfig(path string) error
- func DebugConfig(name ...string)
- func FormatCommunicationRate(fileSize float64) (size string)
- func FormatFileSize(fileSize int64) (size string)
- func GetExePath() string
- func GetOption(parser *gcmd.Parser, name string, defaultValue ...string) (result string)
- func GetOptionNodeOrConfig(index int, parser *gcmd.Parser, nodeNameInConfig string, name string, ...) (result string)
- func GetOptionOrConfig(index int, parser *gcmd.Parser, nodeNameInConfig string, name string, ...) (result string)
- func ScanMdFiles(path string) []string
- func SelectConfig() string
- func SelectFile(path string, pattern string) string
- func WriteTomlConfig(path string, name ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyConfig ¶ added in v0.2.0
CopyConfig 将 <path> 指定的文件拷贝到 DefaultRunConfig,同时备份原有 文件为 DefaultRunConfig .yyyymmddhhmmss.bak
func DebugConfig ¶ added in v0.2.0
func DebugConfig(name ...string)
func FormatCommunicationRate ¶
FormatCommunicationRate 通讯速率换算 传入参数单位为 B/s
func FormatFileSize ¶
FormatFileSize 字节的单位转换 保留两位小数
func GetOptionNodeOrConfig ¶ added in v0.2.0
func GetOptionNodeOrConfig(index int, parser *gcmd.Parser, nodeNameInConfig string, name string, defaultValue ...string) (result string)
GetOptionNodeOrConfig 通过选项或者配置文件获取配置数据 选项名称为 nodeNameInConfig.name
func GetOptionOrConfig ¶ added in v0.2.0
func GetOptionOrConfig(index int, parser *gcmd.Parser, nodeNameInConfig string, name string, defaultValue ...string) (result string)
GetOptionOrConfig 通过选项或者配置文件获取配置数据
func SelectFile ¶
SelectFile 遍历文件夹下的文件内容让用户选择 不查找子文件夹
func WriteTomlConfig ¶ added in v0.2.0
WriteTomlConfig 将 <name> 指定的配置信息写入文件 <path> , 若文件存在会先备份文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.