mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-07 01:45:27 +08:00
25 lines
857 B
Go
25 lines
857 B
Go
package proxies
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
)
|
|
|
|
func RegisterRoutes(r chi.Router, h *Handler) {
|
|
r.Get("/proxies", h.listProxies)
|
|
r.Post("/proxies", h.addProxy)
|
|
r.Put("/proxies/{proxyID}", h.updateProxy)
|
|
r.Delete("/proxies/{proxyID}", h.deleteProxy)
|
|
r.Post("/proxies/test", h.testProxy)
|
|
r.Put("/accounts/{identifier}/proxy", h.updateAccountProxy)
|
|
}
|
|
|
|
func (h *Handler) AddProxy(w http.ResponseWriter, r *http.Request) { h.addProxy(w, r) }
|
|
func (h *Handler) UpdateProxy(w http.ResponseWriter, r *http.Request) { h.updateProxy(w, r) }
|
|
func (h *Handler) DeleteProxy(w http.ResponseWriter, r *http.Request) { h.deleteProxy(w, r) }
|
|
func (h *Handler) TestProxy(w http.ResponseWriter, r *http.Request) { h.testProxy(w, r) }
|
|
func (h *Handler) UpdateAccountProxy(w http.ResponseWriter, r *http.Request) {
|
|
h.updateAccountProxy(w, r)
|
|
}
|