Documentation ¶
Index ¶
- Variables
- func ConnectDB()
- func ConnectRedis()
- func DeleteToken(token string) error
- func DisconnectDB()
- func GetToken(token string) (bool, error)
- func SendResponse(ctx echo.Context, statusCode int, message string, details ...interface{}) error
- func SetToken(token string, expiration time.Duration) error
- type APIResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DB *mongo.Database
)
View Source
var (
RedisClient *redis.Client
)
Functions ¶
func DisconnectDB ¶
func DisconnectDB()
func SendResponse ¶
SendResponse sends an API response with the given status code, status, message, and optional data or error details
Types ¶
type APIResponse ¶
type APIResponse struct { Status string `json:"status"` Message string `json:"message"` Data interface{} `json:"data,omitempty"` Error interface{} `json:"error,omitempty"` }
APIResponse represents a generic API response
Click to show internal directories.
Click to hide internal directories.