mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-18 15:23:51 +01:00
refactor and remove unused code
This commit is contained in:
@@ -32,7 +32,7 @@ func (NopWriteCloser) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewHandler(caCertPEM []byte) http.Handler {
|
||||
func NewHandler() http.Handler {
|
||||
mux := ServeMux{http.NewServeMux()}
|
||||
|
||||
mux.HandleFunc(agent.EndpointProxyHTTP+"/{path...}", ProxyHTTP)
|
||||
@@ -40,9 +40,6 @@ func NewHandler(caCertPEM []byte) http.Handler {
|
||||
mux.HandleMethods("GET", agent.EndpointName, func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, env.AgentName)
|
||||
})
|
||||
mux.HandleMethods("GET", agent.EndpointCACert, func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write(caCertPEM)
|
||||
})
|
||||
mux.HandleMethods("GET", agent.EndpointHealth, CheckHealth)
|
||||
mux.HandleMethods("GET", agent.EndpointLogs, memlogger.LogsWS(nil))
|
||||
mux.ServeMux.HandleFunc("/", DockerSocketHandler())
|
||||
|
||||
Reference in New Issue
Block a user