Documentation ¶
Index ¶
- Constants
- Variables
- func BadRequest(c *gin.Context, message string)
- func GetReturningColumnNames(db *gorm.DB, _DataEntity interface{}, config models.Config) []string
- func GetStructName(dataEntity interface{}) string
- func IfElementExists(arr []string, e string) bool
- func InfoHandler(info map[string]interface{}) gin.HandlerFunc
- func InternalServerError(c *gin.Context)
- func IsUUIDValid(u string) bool
- func NewUUID() uuid.UUID
- func NewUUIDStr() string
- func ParseBody(c *gin.Context, strict bool, keys []string) map[string]interface{}
- func ParseBodyNonStrict(c *gin.Context, keys ...string) map[string]interface{}
- func ParseBodyStrict(c *gin.Context, keys ...string) map[string]interface{}
- func PgErrorCodeAndMessage(err error) (string, string)
- func ReturningColumnsCalculator(db *gorm.DB, _DataEntity interface{}, config models.Config) clause.Returning
- func SetDefaultConfig(dEName string, config *models.Config)
- func StatusOK(c *gin.Context, data interface{}, message string)
- func StatusOKPag(c *gin.Context, data interface{}, pag Pagination, message string)
- func StrToUUID(s string) uuid.UUID
- func TimeNow(args ...interface{}) interface{}
- func ToCamel(str string) string
- func ToEndpointNameCase(str string) string
- func ToSnake(str string) string
- func UUIDToStr(id uuid.UUID) string
- type Pagination
Constants ¶
View Source
const ( MessageBadRequest = "Bad Request" MessageBadRequestInsufficientData = "Bad Request insufficient data" MessageInvalidBody = "Invalid Body" MessageTemplateInvalidValue = "Invalid %s, please check" MessageError = "Message" )
View Source
const PAGINATION_DEFAULT_LIMIT = 20
Variables ¶
View Source
var NilUUID = uuid.Nil
Functions ¶
func BadRequest ¶
func GetReturningColumnNames ¶
func GetStructName ¶
func GetStructName(dataEntity interface{}) string
func IfElementExists ¶
func InfoHandler ¶
func InfoHandler(info map[string]interface{}) gin.HandlerFunc
func InternalServerError ¶
func IsUUIDValid ¶
func NewUUIDStr ¶
func NewUUIDStr() string
func ParseBodyNonStrict ¶
func PgErrorCodeAndMessage ¶
func SetDefaultConfig ¶
func StatusOKPag ¶
func StatusOKPag(c *gin.Context, data interface{}, pag Pagination, message string)
func ToEndpointNameCase ¶
Types ¶
type Pagination ¶
type Pagination struct { TotalRecords int64 CurrentPage int TotalPages int NextPage int PrevPage int Limit int Offset int }
func NewPagination ¶
func NewPagination(pageString string, args ...int) Pagination
func (*Pagination) ParseString ¶
func (pag *Pagination) ParseString(pageString string)
func (*Pagination) Set ¶
func (pag *Pagination) Set(current int, totalRec int64) *Pagination
func (*Pagination) Validate ¶
func (pag *Pagination) Validate() *Pagination
Click to show internal directories.
Click to hide internal directories.