🏷️ Created Config domain
This commit is contained in:
parent
33e0a240c2
commit
af56446472
|
@ -0,0 +1,16 @@
|
|||
package domain
|
||||
|
||||
import (
|
||||
"net"
|
||||
"net/netip"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Host string `env:"HOME_HOST"`
|
||||
Port uint16 `env:"HOME_PORT" envDefault:"3000"`
|
||||
}
|
||||
|
||||
func (c Config) AddrPort() netip.AddrPort {
|
||||
return netip.MustParseAddrPort(net.JoinHostPort(c.Host, strconv.FormatUint(uint64(c.Port), 16)))
|
||||
}
|
Loading…
Reference in New Issue