mirror of
https://github.com/certimate-go/certimate.git
synced 2026-10-25 10:14:24 +08:00
37 lines
667 B
Go
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(),
|
|
}
|
|
}
|