Documentation
¶
Index ¶
- Variables
- func DeleteCache(key string) error
- func GetCache(key string) (string, error)
- func HandleInternalServerError(c *gin.Context, err error)
- func HandleNotFoundError(c *gin.Context, err error)
- func HandleValidationError(c *gin.Context, err error)
- func InitDB(cfg *config.Config) (*gorm.DB, error)
- func InitRedis(addr string)
- func SetCache(key string, value interface{}, expiration time.Duration) error
- func ValidateStruct(s interface{}) error
- type ErrorResponse
- type Pagination
- type SuccessResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
View Source
var RedisClient *redis.Client
Functions ¶
func DeleteCache ¶
func HandleNotFoundError ¶
func HandleValidationError ¶
func ValidateStruct ¶
func ValidateStruct(s interface{}) error
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Status string `json:"status"` Message string `json:"message"` Error string `json:"error,omitempty"` }
func NewErrorResponse ¶
func NewErrorResponse(message string, err error) ErrorResponse
type Pagination ¶
func GetPagination ¶
func GetPagination(c *gin.Context) Pagination
type SuccessResponse ¶
type SuccessResponse struct { Status string `json:"status"` Data interface{} `json:"data"` Message string `json:"message"` }
func NewSuccessResponse ¶
func NewSuccessResponse(data interface{}, message string) SuccessResponse
Click to show internal directories.
Click to hide internal directories.