mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 20:38:08 +08:00
build: add build tags to create customizable binaries
This commit is contained in:
+2
-8
@@ -21,10 +21,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
gqlHandler "github.com/99designs/gqlgen/graphql/handler"
|
||||
_ "github.com/anuvu/zot/docs" // as required by swaggo
|
||||
"github.com/anuvu/zot/errors"
|
||||
"github.com/anuvu/zot/pkg/extensions/search"
|
||||
ext "github.com/anuvu/zot/pkg/extensions"
|
||||
"github.com/anuvu/zot/pkg/log"
|
||||
"github.com/gorilla/mux"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
@@ -52,11 +51,6 @@ func NewRouteHandler(c *Controller) *RouteHandler {
|
||||
return rh
|
||||
}
|
||||
|
||||
func (rh *RouteHandler) searchHandler() *gqlHandler.Server {
|
||||
resConfig := search.GetResolverConfig(rh.c.Config.Storage.RootDirectory, rh.c.Log, rh.c.ImageStore)
|
||||
return gqlHandler.NewDefaultServer(search.NewExecutableSchema(resConfig))
|
||||
}
|
||||
|
||||
func (rh *RouteHandler) SetupRoutes() {
|
||||
rh.c.Router.Use(AuthHandler(rh.c))
|
||||
g := rh.c.Router.PathPrefix(RoutePrefix).Subrouter()
|
||||
@@ -96,7 +90,7 @@ func (rh *RouteHandler) SetupRoutes() {
|
||||
rh.c.Router.PathPrefix("/swagger/v2/").Methods("GET").Handler(httpSwagger.WrapHandler)
|
||||
// Zot Search Extension Router
|
||||
if rh.c.Config != nil && rh.c.Config.Extensions != nil {
|
||||
rh.c.Router.PathPrefix("/query").Methods("GET", "POST").Handler(rh.searchHandler())
|
||||
ext.SetupRoutes(rh.c.Router, rh.c.Config.Storage.RootDirectory, rh.c.ImageStore, rh.c.Log)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user