Refactor progress

- move directory structure
- string based rule definition
- use traefik rule parsing
- drop toml config
- new flag library
- implement go dep
This commit is contained in:
Thom Seddon
2019-04-12 16:12:13 +01:00
parent 19c249a6d1
commit 814892a88b
17 changed files with 545 additions and 457 deletions

30
cmd/main.go Normal file
View File

@ -0,0 +1,30 @@
package main
import (
"net/http"
internal "github.com/thomseddon/traefik-forward-auth/internal"
)
// Main
func main() {
// Parse options
config := internal.NewGlobalConfig()
// Setup logger
log := internal.NewDefaultLogger()
// Perform config checks
config.Checks()
// Build server
server := internal.NewServer()
// Attach router to default server
http.HandleFunc("/", server.RootHandler)
// Start
log.Debugf("Starting with options: %s", config.Serialise())
log.Info("Listening on :4181")
log.Info(http.ListenAndServe(":4181", nil))
}