diff --git a/api.go b/api.go index f20baf47..27089d55 100644 --- a/api.go +++ b/api.go @@ -9,12 +9,18 @@ import ( "gopkg.in/gin-contrib/cors.v1" ) +<<<<<<< HEAD // StartAPIServer starts the API server func StartAPIServer(config *Config, reloadChan chan bool, blockCache *MemoryBlockCache, questionCache *MemoryQuestionCache) (*http.Server, error) { if config.LogLevel < 2 { +======= +// StartAPIServer launches the API server +func StartAPIServer(config *Config, blockCache *MemoryBlockCache, questionCache *MemoryQuestionCache) error { + if config.LogLevel == 0 { +>>>>>>> 23967dfdc40cde995257c350b7a2dce282953e73 gin.SetMode(gin.ReleaseMode) } diff --git a/main.go b/main.go index fe693732..26606063 100644 --- a/main.go +++ b/main.go @@ -39,6 +39,10 @@ func reloadBlockCache(config *Config, } func main() { + // BlockCache contains all blocked domains + blockCache := &MemoryBlockCache{Backend: make(map[string]bool)} + // QuestionCache contains all queries to the dns server + questionCache := &MemoryQuestionCache{Backend: make([]QuestionCacheEntry, 0), Maxcount: 1000} flag.Parse() diff --git a/server.go b/server.go index 1ffebdad..44ebdaed 100644 --- a/server.go +++ b/server.go @@ -17,7 +17,9 @@ type Server struct { } // Run starts the server -func (s *Server) Run(config *Config, blockCache *MemoryBlockCache, questionCache *MemoryQuestionCache) { +func (s *Server) Run(config *Config, + blockCache *MemoryBlockCache, + questionCache *MemoryQuestionCache) { s.handler = NewHandler(config, blockCache, questionCache) tcpHandler := dns.NewServeMux()