Documentation
¶
Index ¶
- Constants
- func GetConfigFilePath() (configPath, keyPath string)
- func GetConfigStore() (config.Store, config.ConfigProvider, *config.Configuration, error)
- func GetCurrentUser() string
- func GetLocalSudoPassword() string
- func GetPasswordFilePath() string
- func IsValidCIDR(cidrStr string) bool
- func IsValidIP(ipStr string) bool
- func ParseAddr(input string) (string, string, uint16)
- func ParseHost(input string) (string, uint16)
- func ParsePort(input string) uint16
- func ReadPasswordFromTerminal(prompt string) (string, error)
- func ToAbsolutePath(path string) string
- type HostInfo
Constants ¶
View Source
const ( ConfigFileName = "xops_config.yaml" PasswordFileName = "xops_passwords.json" ConfigKeyName = "secret.key" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigFilePath ¶
func GetConfigFilePath() (configPath, keyPath string)
func GetConfigStore ¶
func GetConfigStore() (config.Store, config.ConfigProvider, *config.Configuration, error)
GetConfigStore 返回配置存储、Provider、配置对象及其可能发生的错误
func GetCurrentUser ¶
func GetCurrentUser() string
func GetLocalSudoPassword ¶
func GetLocalSudoPassword() string
GetLocalSudoPassword 尝试从配置文件中获取本地 sudo 密码
func GetPasswordFilePath ¶
func GetPasswordFilePath() string
func ReadPasswordFromTerminal ¶
ReadPasswordFromTerminal 从终端安全地读取密码
func ToAbsolutePath ¶ added in v0.2.0
ToAbsolutePath 将路径转换为绝对路径 支持 ~ 展开和相对路径转绝对路径 如果路径已经是绝对路径,直接返回
Types ¶
Click to show internal directories.
Click to hide internal directories.