This commit is contained in:
Kar
2024-01-08 14:00:41 +05:30
commit dbe86acfac
31 changed files with 1793 additions and 0 deletions

40
core/appserver/server.go Normal file
View File

@@ -0,0 +1,40 @@
package appserver
import (
"gitlab.com/arkadooti.sarkar/go-boilerplate/core/appcontext"
"net/http"
)
type route struct {
Name string
Method string
Pattern string
Modules []string
ResourcesPermissionMap interface{}
HandlerFunc http.HandlerFunc
}
type server struct {
port string
subRoute string
routes []route
}
const (
requestID = "requestId"
userEmail = "email"
application = "application"
locale = "locale"
)
type AppServer interface {
Start(ctx appcontext.AppContext)
AddNoAuthRoutes(methodName string, methodType string, mRoute string, handlerFunc http.HandlerFunc)
}
func NewAppServer(port, subRoute string) AppServer {
return &server{
port: port,
subRoute: subRoute,
}
}