Реорганизация пакета daemon в http.

Упразднён пакет utils.
Удалён обработчик minecraft.php (legacy с самого-самого начала Ely.by)
Добавлены тесты для всех api-запросов.
This commit is contained in:
ErickSkrauch
2017-08-20 01:22:42 +03:00
parent ec461efe34
commit 04714543b8
29 changed files with 1170 additions and 381 deletions

18
http/not_found.go Normal file
View File

@@ -0,0 +1,18 @@
package http
import (
"encoding/json"
"net/http"
)
func (cfg *Config) NotFound(response http.ResponseWriter, request *http.Request) {
data, _ := json.Marshal(map[string]string{
"status": "404",
"message": "Not Found",
"link": "http://docs.ely.by/skin-system.html",
})
response.Header().Set("Content-Type", "application/json")
response.WriteHeader(http.StatusNotFound)
response.Write(data)
}