refactor: move types into a single file for each package

This commit is contained in:
2024-11-04 08:34:47 +01:00
parent b0443c34d7
commit 096290bcb8
9 changed files with 326 additions and 283 deletions

View File

@@ -2,7 +2,6 @@ package pkg
import (
"errors"
"github.com/gorilla/mux"
"slices"
"strings"
)
@@ -18,14 +17,6 @@ func getMiddleware(rules []string, middlewares []Middleware) (Middleware, error)
return Middleware{}, errors.New("middleware not found with name: [" + strings.Join(rules, ";") + "]")
}
type RoutePath struct {
route Route
path string
rules []string
middlewares []Middleware
router *mux.Router
}
func doesExist(tyName string) bool {
middlewareList := []string{BasicAuth, JWTAuth, AccessMiddleware}
if slices.Contains(middlewareList, tyName) {