utils

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnNamePattern

func ColumnNamePattern(name string) string

ColumnNamePattern is the default name patterning for mapping struct fields to table columns

func CreateLogger

func CreateLogger(logFile string) (*slog.Logger, error)

CreateLogger create logger by log file If log file directory not exist, create it

func IsFieldHasSchema

func IsFieldHasSchema(valueOf reflect.Value, i int) bool

IsFieldHasSchema check if field has schema tag or schema suffix

func MakeDirForFile

func MakeDirForFile(filename string) (err error)

MakeDirForFile create directory for file if not exist

func ParseTableNameByType

func ParseTableNameByType(typeOf reflect.Type) string

ParseTableNameByType parse table name by type

func ParseTableNameByValue

func ParseTableNameByValue(valueOf reflect.Value) string

ParseTableNameByValue parse table name by value

func TableNameMethod

func TableNameMethod(valueOf reflect.Value) string

TableNameMethod try to get table name from method TableName If method TableName is not found, return empty string

func TableNamePattern

func TableNamePattern(name string) string

TableNamePattern is the default name patterning for mapping struct to table

func ToSnakeCase

func ToSnakeCase(name string) string

ToSnakeCase convert camelCase or PascalCase to snake_case

Types

This section is empty.

Jump to

Keyboard shortcuts

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