mirror of
https://github.com/Starlio-app/StarlioX
synced 2024-11-22 08:46:22 +03:00
20 lines
451 B
Go
20 lines
451 B
Go
package utils
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/Redume/EveryNasa/functions"
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func Message(status bool, message string) map[string]interface{} {
|
|
return map[string]interface{}{"status": status, "message": message}
|
|
}
|
|
|
|
func Respond(c *fiber.Ctx, data map[string]interface{}) {
|
|
c.Set("Content-Type", "application/json")
|
|
err := json.NewEncoder(c).Encode(data)
|
|
if err != nil {
|
|
functions.Logger(err.Error())
|
|
}
|
|
}
|