summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Anderson <[email protected]>2017-01-01 13:42:47 -0800
committerDavid Anderson <[email protected]>2017-01-01 13:42:47 -0800
commitb321571464ebd231043ead1e15f23dba1c02970c (patch)
treef87aa36cce7462c3ce73f0157fefb15bca0e3ea3
parent55ba69dad29c3f6b3aec89789fc8a773cd776b28 (diff)
Add godoc comments to appease golint.
-rw-r--r--config.go4
-rw-r--r--main.go1
2 files changed, 5 insertions, 0 deletions
diff --git a/config.go b/config.go
index 2c0c797..e0a135a 100644
--- a/config.go
+++ b/config.go
@@ -24,6 +24,7 @@ import (
"sync"
)
+// A Route maps a match on a domain name to a backend.
type Route struct {
match *regexp.Regexp
backend string
@@ -54,6 +55,7 @@ func dnsRegex(s string) (*regexp.Regexp, error) {
return regexp.Compile(strings.Join(b, `\.`))
}
+// Match returns the backend for hostname.
func (c *Config) Match(hostname string) string {
c.mu.Lock()
defer c.mu.Unlock()
@@ -65,6 +67,7 @@ func (c *Config) Match(hostname string) string {
return ""
}
+// Read replaces the current Config with one read from r.
func (c *Config) Read(r io.Reader) error {
var routes []Route
@@ -97,6 +100,7 @@ func (c *Config) Read(r io.Reader) error {
return nil
}
+// ReadFile replaces the current Config with one read from path.
func (c *Config) ReadFile(path string) error {
f, err := os.Open(path)
if err != nil {
diff --git a/main.go b/main.go
index 88e24b3..858bc74 100644
--- a/main.go
+++ b/main.go
@@ -53,6 +53,7 @@ func main() {
}
}
+// A Conn handles the TLS proxying of one user connection.
type Conn struct {
*net.TCPConn