mirror of
https://github.com/Starlio-app/Starlio-web.git
synced 2024-12-27 10:43:46 +03:00
15 lines
349 B
Go
15 lines
349 B
Go
package utils
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
func Message(status bool, message string) map[string]interface{} {
|
|
return map[string]interface{}{"status": status, "message": message}
|
|
}
|
|
|
|
func Respond(w http.ResponseWriter, data map[string]interface{}) {
|
|
w.Header().Add("Content-Type", "application/json")
|
|
json.NewEncoder(w).Encode(data)
|
|
}
|