Removed Host() and Port() functions from Controller

I don't think they'll be necessary; can get same info from request Host header
This commit is contained in:
Matthew Holt 2015-04-15 23:17:28 -06:00
parent feec7c5b40
commit c7af6725ca
3 changed files with 0 additions and 26 deletions

View File

@ -42,16 +42,6 @@ func (c *controller) Root() string {
}
}
// Host returns the hostname the server is bound to.
func (c *controller) Host() string {
return c.parser.cfg.Host
}
// Port returns the port that the server is listening on.
func (c *controller) Port() string {
return c.parser.cfg.Port
}
// Context returns the path scope that the Controller is in.
func (c *controller) Context() middleware.Path {
return middleware.Path(c.pathScope)

View File

@ -30,16 +30,6 @@ func TestController(t *testing.T) {
t.Errorf("Expected established root path to be '%s', got '%s'", c.parser.cfg.Root, root)
}
c.parser.cfg.Host = "localhost"
if host := c.Host(); host != c.parser.cfg.Host {
t.Errorf("Expected host to be '%s', got '%s'", c.parser.cfg.Host, host)
}
c.parser.cfg.Port = "1234"
if port := c.Port(); port != c.parser.cfg.Port {
t.Errorf("Expected port to be '%s', got '%s'", c.parser.cfg.Port, port)
}
c.pathScope = "unused"
if context := c.Context(); string(context) != c.pathScope {
t.Errorf("Expected context to be '%s', got '%s'", c.pathScope, context)

View File

@ -59,12 +59,6 @@ type (
// Root returns the file path from which the server is serving.
Root() string
// Host returns the hostname the server is bound to.
Host() string
// Port returns the port that the server is listening on.
Port() string
// Context returns the path scope that the Controller is in.
// Note: This is not currently used, but may be in the future.
Context() Path