library

package
v0.0.0-...-779c436 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBucket       = errors.New("Invalid bucket!")
	ErrSize         = errors.New("Invalid size!")
	ErrInvalidImage = errors.New("Invalid image!")
)
View Source
var (
	ErrFileBucket  = errors.New("Invalid bucket!")
	ErrFileSize    = errors.New("Invalid size!")
	ErrInvalidFile = errors.New("Invalid File!")
)

Functions

func DTExportToExcel

func DTExportToExcel(Config DataTableConfig) (string, error)

func DTGenerateColumn

func DTGenerateColumn(col []map[string]interface{}) string

func DTGenerateOrder

func DTGenerateOrder(col []map[string]interface{}, req map[string]interface{}) string

func DTGenerateWhere

func DTGenerateWhere(col []map[string]interface{}, req map[string]interface{}) string

func DTGeneratorLimit

func DTGeneratorLimit(req map[string]interface{}) string

func DataTable

func DataTable(Config DataTableConfig) (interface{}, error)

func DataTableTest

func DataTableTest() string

func FileExists

func FileExists(name string) (bool, error)

func GenUID

func GenUID(sequence int, lengthNumber int, charMaxLenght int) string

func GenUIDToAlpha

func GenUIDToAlpha(num int, addString string, ln int) string

func GenerateQRCode

func GenerateQRCode(data string, savepath string, size int) error

func GetBreadCrumb

func GetBreadCrumb(mode int, url string, db *gorm.DB)

func GetPackagingStatusMinimum

func GetPackagingStatusMinimum(status []string) string

func GetPackagingStatusMinimumQuery

func GetPackagingStatusMinimumQuery(status []string, tx *gorm.DB) string

func InArray

func InArray(val interface{}, array interface{}) (index int)

func IsDateTimeValue

func IsDateTimeValue(stringDate string) bool

func IsDateValue

func IsDateValue(stringDate string) bool

func IsJSON

func IsJSON(s string) bool

func IsTimeValue

func IsTimeValue(stringDate string) bool

func JsonDecode

func JsonDecode(data string) (map[string]interface{}, error)

json decode

func JsonEncode

func JsonEncode(data interface{}) (string, error)

json encode

func JsonReqBody

func JsonReqBody(c *gin.Context) (map[string]interface{}, error)

parse json requst Body

func NumberFormat

func NumberFormat(number float64, decimals uint, decPoint, thousandsSep string) string

func PackagingStatusLabel

func PackagingStatusLabel(status int) string

func RandString

func RandString(n int) string

func RandStringFromDb

func RandStringFromDb(n int, db *gorm.DB, table string, cols string) string

func SaveFileToDisk

func SaveFileToDisk(fileNameBase string, data string) (string, error)

func SaveImageToDisk

func SaveImageToDisk(fileNameBase, data string) (string, error)

func StructToJson

func StructToJson(b interface{}) map[string]string

Types

type DataTableConfig

type DataTableConfig struct {
	Primary    string
	Where      string
	Group      string
	Order      string
	Result     interface{}
	Column     []map[string]interface{}
	Table      string
	Connection *gorm.DB
	Request    map[string]interface{}
	TableCount string
}

type DataTableOutput

type DataTableOutput struct {
	Draw            int         `json:"draw"`
	RecordsTotal    int         `json:"recordsTotal"`
	RecordsFiltered int         `json:"recordsFiltered"`
	Data            interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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