INNER CODE UNIT · Go

func

loggie-io/loggie · pkg/control/http.go:27

func (c *Controller) initHttp() {
	http.HandleFunc(HandleCurrentPipelines, c.currentPipelinesHandler)
}

func (c *Controller) currentPipelinesHandler(writer http.ResponseWriter, request *http.Request) {
	data, err := yaml.Marshal(c.CurrentConfig)
	if err != nil {
		log.Warn("marshal current pipeline config err: %v", err)
		writer.WriteHeader(http.StatusInternalServerError)
		writer.Write([]byte(err.Error()))
		return
	}

	writer.WriteHeader(http.StatusOK)
	writer.Write(data)
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…