mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-21 07:51:28 +02:00
added v1/list/match_domains
This commit is contained in:
@@ -16,6 +16,7 @@ const (
|
|||||||
ListConfigFiles = "config_files"
|
ListConfigFiles = "config_files"
|
||||||
ListMiddlewares = "middlewares"
|
ListMiddlewares = "middlewares"
|
||||||
ListMiddlewareTrace = "middleware_trace"
|
ListMiddlewareTrace = "middleware_trace"
|
||||||
|
ListMatchDomains = "match_domains"
|
||||||
)
|
)
|
||||||
|
|
||||||
func List(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
|
func List(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -33,6 +34,8 @@ func List(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
|
|||||||
listMiddlewares(w, r)
|
listMiddlewares(w, r)
|
||||||
case ListMiddlewareTrace:
|
case ListMiddlewareTrace:
|
||||||
listMiddlewareTrace(w, r)
|
listMiddlewareTrace(w, r)
|
||||||
|
case ListMatchDomains:
|
||||||
|
listMatchDomains(cfg, w, r)
|
||||||
default:
|
default:
|
||||||
U.HandleErr(w, r, U.ErrInvalidKey("what"), http.StatusBadRequest)
|
U.HandleErr(w, r, U.ErrInvalidKey("what"), http.StatusBadRequest)
|
||||||
}
|
}
|
||||||
@@ -71,3 +74,7 @@ func listMiddlewareTrace(w http.ResponseWriter, r *http.Request) {
|
|||||||
func listMiddlewares(w http.ResponseWriter, r *http.Request) {
|
func listMiddlewares(w http.ResponseWriter, r *http.Request) {
|
||||||
U.HandleErr(w, r, U.RespondJson(w, middleware.All()))
|
U.HandleErr(w, r, U.RespondJson(w, middleware.All()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func listMatchDomains(cfg *config.Config, w http.ResponseWriter, r *http.Request) {
|
||||||
|
U.HandleErr(w, r, U.RespondJson(w, cfg.Value().MatchDomains))
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user