Files
certimate/internal/tools/ssh/config.go
T
2026-01-22 21:21:16 +08:00

37 lines
667 B
Go

package ssh
const (
defaultPort int = 22
defaultAuthMethod AuthMethodType = AuthMethodTypeNone
defaultUsername string = "root"
)
type ServerConfig struct {
Host string
Port int
AuthMethod AuthMethodType
Username string
Password string
Key string
KeyPassphrase string
}
type Config struct {
ServerConfig
JumpServers []ServerConfig
}
func NewServerConfig() *ServerConfig {
return &ServerConfig{
Port: defaultPort,
AuthMethod: defaultAuthMethod,
Username: defaultUsername,
}
}
func NewDefaultConfig() *Config {
return &Config{
ServerConfig: *NewServerConfig(),
}
}