utils

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnake

func CamelToSnake(str string) string

func IsProduction

func IsProduction() bool

func QueryToUint

func QueryToUint(query string) uint

func ReturnErrorResponse

func ReturnErrorResponse(c *fiber.Ctx, err error, data interface{}) error

func ReturnSuccessResponse

func ReturnSuccessResponse(c *fiber.Ctx, code int, msg string, data interface{}) error

func StructToJSONString added in v1.1.0

func StructToJSONString(s any) string

Convert struct to json string. Error ignored

Types

type JSONResponse

type JSONResponse struct {
	Success   bool        `json:"success"`
	Message   string      `json:"message"`
	Data      interface{} `json:"data"`
	Timestamp int64       `json:"timestamp"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL