Documentation ¶
Index ¶
- func Camel2Case(name string) string
- func CamelString(s string) string
- func Case2Camel(name string) string
- func GetCreateTableFromDB(dsn, tableName string) (string, error)
- func Lcfirst(str string) string
- func ParseSqlToWrite(sql string, writer io.Writer, options ...Option) error
- func SnakeString(s string) string
- func Ucfirst(str string) string
- type Buffer
- type JsonCamelCase
- type JsonSnakeCase
- type ModelCodes
- type NullStyle
- type Option
- func WithCharset(charset string) Option
- func WithCollation(collation string) Option
- func WithColumnPrefix(p string) Option
- func WithDbTag() Option
- func WithForceTableName() Option
- func WithGormType() Option
- func WithJsonTag() Option
- func WithNoNullType() Option
- func WithNullStyle(s NullStyle) Option
- func WithPackage(pkg string) Option
- func WithTablePrefix(p string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Camel2Case ¶
************************************** 其他方法 ************************************** 驼峰式写法转为下划线写法
func CamelString ¶
*
- 蛇形转驼峰
- @description xx_yy to XxYx xx_y_y to XxYY
- @date 2020/7/30
- @param s要转换的字符串
- @return string *
func GetCreateTableFromDB ¶
func SnakeString ¶
*
- 驼峰转蛇形 snake string
- @description XxYy to xx_yy , XxYY to xx_y_y
- @date 2020/7/30
- @param s 需要转换的字符串
- @return string *
Types ¶
type JsonCamelCase ¶
type JsonCamelCase struct {
Value interface{}
}
************************************** 驼峰json **************************************
func (JsonCamelCase) MarshalJSON ¶
func (c JsonCamelCase) MarshalJSON() ([]byte, error)
type JsonSnakeCase ¶
type JsonSnakeCase struct {
Value interface{}
}
************************************** 下划线json **************************************
func (JsonSnakeCase) MarshalJSON ¶
func (c JsonSnakeCase) MarshalJSON() ([]byte, error)
type ModelCodes ¶
func ParseSqlFromDB ¶
func ParseSqlFromDB(dsn, tableName string, options ...Option) (ModelCodes, error)
type Option ¶
type Option func(*options)
func WithCharset ¶
func WithCollation ¶
func WithColumnPrefix ¶
func WithForceTableName ¶
func WithForceTableName() Option
func WithJsonTag ¶
func WithJsonTag() Option
func WithNoNullType ¶
func WithNoNullType() Option
func WithNullStyle ¶
func WithPackage ¶
func WithTablePrefix ¶
Click to show internal directories.
Click to hide internal directories.