27 lines
1.1 KiB
Go
27 lines
1.1 KiB
Go
package ssh
|
|
|
|
import (
|
|
"github.com/Neur0toxine/sshpoke/internal/server/driver/ssh/types"
|
|
"github.com/Neur0toxine/sshpoke/internal/server/driver/util"
|
|
)
|
|
|
|
type Params struct {
|
|
Address string `mapstructure:"address" validate:"required"`
|
|
DefaultHost *string `mapstructure:"default_host,omitempty"`
|
|
ForwardPort uint16 `mapstructure:"forward_port"`
|
|
Auth types.Auth `mapstructure:"auth"`
|
|
KeepAlive types.KeepAlive `mapstructure:"keepalive"`
|
|
Domain string `mapstructure:"domain"`
|
|
DomainProto string `mapstructure:"domain_proto"`
|
|
DomainExtractRegex string `mapstructure:"domain_extract_regex" validate:"validregexp"`
|
|
Mode types.DomainMode `mapstructure:"mode" validate:"required,oneof=single multi"`
|
|
DisableRemoteHostResolve bool `mapstructure:"disable_remote_host_resolve"`
|
|
}
|
|
|
|
func (p *Params) Validate() error {
|
|
if err := util.Validator.Struct(p); err != nil {
|
|
return err
|
|
}
|
|
return p.Auth.Validate()
|
|
}
|