Documentation ¶
Index ¶
- Constants
- func CalcPageOffset(pager *Pager) (offset int)
- func MapList[T, K any](list []*T, mapFunc func(*T) K) []K
- func MapListDistinct[T, K comparable](list []*T, mapFunc func(*T) K) []K
- func Paginate(sql *gorm.DB, pager *Pager) *gorm.DB
- func PaginateWithDefaultOrder(c fiber.Ctx) func(db *gorm.DB) *gorm.DB
- func ToFieldMap[T any, K comparable](list *[]*T, keyFunc func(*T) K) map[K]*T
- func Valid(i interface{}) error
- func ValidField(i interface{}, tag string) error
- func WaitFor(intervalMillis int, times int, completeFunc func() bool) error
- type BaseModel
- type Pager
- type StructValidator
- type TimeRange
Constants ¶
View Source
const ( APP_CONFIG_ENV_KEY = "APP_CONFIG_FILE" APP_DEVELOPMENT_ENV_KEY = "APP_DEVELOPMENT" )
View Source
const ( MAXIMUM_PAGE_SIZE = 64 DEFAULT_PAGE_SIZE = 10 )
Variables ¶
This section is empty.
Functions ¶
func CalcPageOffset ¶
func MapListDistinct ¶
func MapListDistinct[T, K comparable](list []*T, mapFunc func(*T) K) []K
func PaginateWithDefaultOrder ¶
gorm paginate support
func ToFieldMap ¶
func ToFieldMap[T any, K comparable](list *[]*T, keyFunc func(*T) K) map[K]*T
func ValidField ¶
Types ¶
type StructValidator ¶
type StructValidator struct {
V *validator.Validate
}
func (*StructValidator) Validate ¶
func (v *StructValidator) Validate(i interface{}) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.