home/internal/domain/config.go

17 lines
307 B
Go

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)))
}