From 0bf5646eb7848b92d746b426132384749fbbadf2 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 9 Jul 2018 00:32:19 +0200 Subject: [PATCH] remove setters for checker/middleware build folders --- server.go | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/server.go b/server.go index a2adfab..8eb176c 100644 --- a/server.go +++ b/server.go @@ -12,8 +12,7 @@ import ( "net/http" ) -// Init initilises a new framework instance -// - path is the configuration file +// New creates a framework instance from a configuration file func New(path string) (*Server, error) { /* (1) Init instance */ @@ -30,27 +29,15 @@ func New(path string) (*Server, error) { inst.config = config /* (3) Default type registry */ - inst.SetTypeFolder(".build/type") + inst.Checker = checker.CreateRegistry(".build/type") /* (4) Default middleware registry */ - inst.SetMiddlewareFolder(".build/middleware") + inst.Middleware = middleware.CreateRegistry(".build/middleware") return inst, nil } -// Create the type (checker) registry from -// a given folder -func (s *Server) SetTypeFolder(path string) { - s.Checker = checker.CreateRegistry(path) -} - -// Create the middleware registry from -// a given folder -func (s *Server) SetMiddlewareFolder(path string) { - s.Middleware = middleware.CreateRegistry(path) -} - // Listens and binds the server to the given port func (s *Server) Listen(port uint16) error {