import sources from develop/0.1.0

This commit is contained in:
Thomas Peetz
2025-04-29 12:52:55 +02:00
parent 304005822c
commit 4c96de27db
976 changed files with 58265 additions and 0 deletions
@@ -0,0 +1,20 @@
package response
import (
"encoding/json"
"net/http"
)
// Response is a generic HTTP Response Struct
type Response struct {
Data string `json:"data"`
}
// Send a HTTP Response
func Send(responseWriter http.ResponseWriter, code int, payload interface{}, contentType string) {
response, _ := json.Marshal(payload)
responseWriter.Header().Set("Content-Type", contentType)
responseWriter.WriteHeader(code)
responseWriter.Write(response)
}