Documentation
¶
Overview ¶
Package names provides naming convention mappers for converting between Go struct field names and database column/table names. Compatible with xorm's naming interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GonicMapper ¶
GonicMapper is like SnakeMapper but treats common initialisms as single words (e.g. "ID" → "id", "HTTP" → "http", "URL" → "url").
func NewGonicMapper ¶
func NewGonicMapper() GonicMapper
NewGonicMapper returns a GonicMapper with common Go initialisms.
func (GonicMapper) Obj2Table ¶
func (m GonicMapper) Obj2Table(name string) string
func (GonicMapper) Table2Obj ¶
func (m GonicMapper) Table2Obj(name string) string
type PrefixMapper ¶
PrefixMapper adds a prefix to table names.
func (PrefixMapper) Obj2Table ¶
func (m PrefixMapper) Obj2Table(name string) string
func (PrefixMapper) Table2Obj ¶
func (m PrefixMapper) Table2Obj(name string) string
type SameMapper ¶
type SameMapper struct{}
SameMapper performs no conversion — names pass through unchanged.
func (SameMapper) Obj2Table ¶
func (SameMapper) Obj2Table(name string) string
func (SameMapper) Table2Obj ¶
func (SameMapper) Table2Obj(name string) string
type SnakeMapper ¶
type SnakeMapper struct{}
SnakeMapper converts CamelCase to snake_case and back.
func (SnakeMapper) Obj2Table ¶
func (SnakeMapper) Obj2Table(name string) string
func (SnakeMapper) Table2Obj ¶
func (SnakeMapper) Table2Obj(name string) string
Click to show internal directories.
Click to hide internal directories.