helper

package
v1.9.15 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: CC0-1.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFolder

func CheckFolder(folderPath string)

func ConstructColNameAndValue

func ConstructColNameAndValue(ctx context.Context, structName interface{}, isNullStruct ...bool) ([]string, []interface{})

func ConstructColNameAndValueBulk added in v0.5.0

func ConstructColNameAndValueBulk(ctx context.Context, arrayOfData interface{}, conditions ...map[string][]interface{}) (*database.CUDConstructData, error)

func ConstructColNameAndValueForUpdate

func ConstructColNameAndValueForUpdate(_ context.Context, structName interface{}, anotherValues ...interface{}) *database.CUDConstructData

func GenerateRandomString

func GenerateRandomString(length int) string

func GenerateRandomStringWithCharset

func GenerateRandomStringWithCharset(length int, charset string) string

func GenerateSelectCols

func GenerateSelectCols(ctx context.Context, source interface{}, isNullStruct ...bool) []string

func GenerateUUID

func GenerateUUID() string

func GenerateUUIDV4

func GenerateUUIDV4() string

func GetColorUniform added in v1.2.0

func GetColorUniform(hexColor string) *image.Uniform

func GetFilePath

func GetFilePath() string

func GetFolderAndFileName

func GetFolderAndFileName(path string) (folderPath string, fileName string)

func GetFolderNameWithoutTmp

func GetFolderNameWithoutTmp(path string) (folderName string)

func GetTemplate added in v1.1.6

func GetTemplate(file string, args, destStruct interface{}) error

func GetTemplateFS added in v1.4.0

func GetTemplateFS(embedFS embed.FS, file string, args, destStruct interface{}) error

func GetTmpFolderPath added in v0.2.0

func GetTmpFolderPath() (string, error)

func ParseFileTemplate added in v1.4.0

func ParseFileTemplate(filePath string, args interface{}, additionalBodyContent ...string) (bytes.Buffer, error)

func ParseHexColor added in v1.1.12

func ParseHexColor(s string) (c color.RGBA, err error)

func ParseTemplate added in v1.1.8

func ParseTemplate(embedFS embed.FS, file string, args interface{}, additionalBodyContent ...string) (bytes.Buffer, error)

func ToCamelCase

func ToCamelCase(str string) string

ToCamelCase - will be convert string to camel case format

example:"AnyKind of_string"
result:"AnyKindOfString"

func ToLowerCamelCase

func ToLowerCamelCase(str string) string

ToLowerCamelCase - will be convert string to camel case format with lower case at first letter

example:"AnyKind of_string"
result:"anyKindOfString"

func ToSnakeCase

func ToSnakeCase(s string) string

ToSnakeCase - will be convert string to snake case format

example:"AnyKind of_string"
result:"any_kind_of_string"

func TrimDuplicatedSpace

func TrimDuplicatedSpace(str string) string

func UploadToTmp

func UploadToTmp(ctx context.Context, path *string, file multipart.File, cloudStorage ...*CloudStorageTmpUpload) error

Types

type CloudStorageTmpUpload added in v1.7.6

type CloudStorageTmpUpload struct {
	Storage       storage.Buckets
	TmpBucketName string
}

Jump to

Keyboard shortcuts

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