41 lines
800 B
Go
41 lines
800 B
Go
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,
|
|
}
|
|
}
|