2024-07-23 14:48:37 +08:00
|
|
|
package dto
|
|
|
|
|
|
2026-03-19 15:25:19 +08:00
|
|
|
import "time"
|
2024-07-23 14:48:37 +08:00
|
|
|
|
|
|
|
|
type HostOperate struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
GroupID uint `json:"groupID"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Addr string `json:"addr" validate:"required"`
|
|
|
|
|
Port uint `json:"port" validate:"required,number,max=65535,min=1"`
|
|
|
|
|
User string `json:"user" validate:"required"`
|
2026-11-24 09:53:25 +08:00
|
|
|
AuthMode string `json:"authMode" validate:"oneof=password key passwordless"`
|
2024-07-23 14:48:37 +08:00
|
|
|
Password string `json:"password"`
|
|
|
|
|
PrivateKey string `json:"privateKey"`
|
|
|
|
|
PassPhrase string `json:"passPhrase"`
|
|
|
|
|
RememberPassword bool `json:"rememberPassword"`
|
|
|
|
|
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type HostConnTest struct {
|
2026-11-24 09:53:25 +08:00
|
|
|
ConfigurePasswordless bool `json:"configurePasswordless"`
|
|
|
|
|
BootstrapAuth string `json:"bootstrapAuth" validate:"required_if=ConfigurePasswordless true,omitempty,oneof=password key"`
|
|
|
|
|
Addr string `json:"addr" validate:"required"`
|
|
|
|
|
Port uint `json:"port" validate:"required,number,max=65535,min=1"`
|
|
|
|
|
User string `json:"user" validate:"required"`
|
|
|
|
|
AuthMode string `json:"authMode" validate:"oneof=password key passwordless"`
|
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
PrivateKey string `json:"privateKey"`
|
|
|
|
|
PassPhrase string `json:"passPhrase"`
|
2024-07-23 14:48:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SearchForTree struct {
|
|
|
|
|
Info string `json:"info"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type HostInfo struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
|
GroupID uint `json:"groupID"`
|
|
|
|
|
GroupBelong string `json:"groupBelong"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Addr string `json:"addr"`
|
|
|
|
|
Port uint `json:"port"`
|
|
|
|
|
User string `json:"user"`
|
|
|
|
|
AuthMode string `json:"authMode"`
|
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
PrivateKey string `json:"privateKey"`
|
|
|
|
|
PassPhrase string `json:"passPhrase"`
|
|
|
|
|
RememberPassword bool `json:"rememberPassword"`
|
|
|
|
|
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type HostTree struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
Label string `json:"label"`
|
|
|
|
|
Children []TreeChild `json:"children"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type TreeChild struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
Label string `json:"label"`
|
|
|
|
|
}
|