INNER CODE UNIT · Go
func
megaease/easemesh · go-sdk/stdlib/stdlib.go:79
func (a *Agent) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/health" {
return
}
if r.URL.Path == "/config" {
a.handleConfig(w, r)
}
}
func (a *Agent) handleConfig(w http.ResponseWriter, r *http.Request) {
body, err := ioutil.ReadAll(r.Body)
if err != nil {
log.Printf("read config body failed: %v", err)
return
}
config := &AgentConfig{}