Documentation ¶
Overview ¶
Global name format functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // struct name // return table name TableName = func(s string) string { return s } // field name, struct name, table name // if relation's struct name, primary key field name, table name and primary key column name // return column name ColumnName = func(a ...string) string { if len(a) == 3 { return a[0] } else { return a[3] + a[4] } } // field name, left struct name, left table name, right struct name, right table name // return many to many table name ManyToManyTableName = func(a ...string) string { if a[1] > a[3] { return a[3] + a[1] } else { return a[1] + a[3] } } // struct name, table name // return snapshot table name, id column name, time column name SnapshotName = func(s, t string) (string, string, string) { return "Snapshot" + s, "SnapshotId", "SnapshotTime" } )
Functions ¶
func CamelToUnderline ¶
ignore camel's underline, first upper not add underline
func UnderlineToCamel ¶
more than one underline as one, first always upper
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.