summaryrefslogtreecommitdiff
path: root/utils/urls/registery.go
blob: d1bff936526de6056dc95ae6648cd90f351c8271 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package urls

import (
	"sync"

	"lain/types"

	"github.com/gofiber/fiber/v2"
)

type registeredRoute struct {
	method    types.HTTPMethod
	path      string
	handler   fiber.Handler
	namespace string
	name      string
	fullPath  string
}

type routeRegistry struct {
	mutex            sync.Mutex
	currentNamespace string
	routes           map[string]registeredRoute
}

var registry = &routeRegistry{
	routes: make(map[string]registeredRoute),
}