From 7819a23171145e8a626e8357e88446817c8785dc Mon Sep 17 00:00:00 2001 From: Melonai Date: Mon, 26 Jul 2021 14:12:26 +0200 Subject: Refactor into packages --- config.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'config.go') diff --git a/config.go b/config.go index cd315c0..b4e0754 100644 --- a/config.go +++ b/config.go @@ -1,4 +1,4 @@ -package main +package portgate import "fmt" @@ -37,3 +37,9 @@ func (c *Config) PortgateAddress() string { func (c *Config) TargetAddress(port int) string { return fmt.Sprintf("%s:%d", c.targetHost, port) } + +// MakeUrl creates the URL on the destination host that the user wants to access. +func (c *Config) MakeUrl(p Path) string { + // TODO: Figure out what to do with TLS + return fmt.Sprintf("http://%s:%d%s", c.targetHost, p.DestinationIdentifier, p.ResourcePath) +} -- cgit 1.4.1