Make SSH_PORT configurable
This commit is contained in:
parent
2bcd70c1ec
commit
4752c0fcec
9 changed files with 25 additions and 7 deletions
|
|
@ -46,6 +46,7 @@ var knownParsers map[string]Parser[any] = map[string]Parser[any]{
|
|||
"domain": asGenericParser(ParseValidDomain),
|
||||
"domains": asGenericParser(ParseValidDomains),
|
||||
"number": asGenericParser(ParseNumber),
|
||||
"port": asGenericParser(ParsePort),
|
||||
"https_url": asGenericParser(ParseHttpsURL),
|
||||
"slug": asGenericParser(ParseSlug),
|
||||
"file": asGenericParser(ParseFile),
|
||||
|
|
|
|||
|
|
@ -76,6 +76,12 @@ func ParseNumber(env environment.Environment, s string) (int, error) {
|
|||
return int(value), err
|
||||
}
|
||||
|
||||
// ParsePort parses s as a port
|
||||
func ParsePort(env environment.Environment, s string) (uint16, error) {
|
||||
value, err := strconv.ParseUint(s, 10, 16)
|
||||
return uint16(value), err
|
||||
}
|
||||
|
||||
// ParseHttpsURL parses a string into a url that starts with 'https://'
|
||||
func ParseHttpsURL(env environment.Environment, s string) (*url.URL, error) {
|
||||
url, err := url.Parse(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue