Documentation
¶
Index ¶
- Constants
- func FindGoModFile(filename string) (string, string, error)
- func GetFileName() (string, error)
- func GetPackageName(fileName string) (string, error)
- func GetStructName(fileName string) (string, error)
- func GetTableName(fileName string) (string, error)
- func ModifyTmpl(moduleName, pathName string) string
- func NewInterfaceTemplate() (*template.Template, error)
- func NewStorageTemplate(module, pathname string) (*template.Template, error)
- func WrongMethodName() string
- type Storage
- type TemplateData
- type Test
Constants ¶
View Source
const InterfaceTemplate = `` /* 562-byte string literal not displayed */
View Source
const StorageTemplate = `` /* 2455-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func GetPackageName ¶
функция для получения имени пакета из файла
func GetStructName ¶
функция парсинга имени структуры
func GetTableName ¶
функция парсинга имени таблицы из метода TableName в файле
func ModifyTmpl ¶
func NewInterfaceTemplate ¶
func NewStorageTemplate ¶
func WrongMethodName ¶
func WrongMethodName() string
Types ¶
type Storage ¶
type Storage struct { FileName string StorageTemplate *template.Template InterfaceTemplate *template.Template TemplateData TemplateData }
func NewStorage ¶
func (*Storage) CreateStorageFiles ¶
type TemplateData ¶
type TemplateData struct { PackageName string // имя пакета TableName string // имя таблицы EntityName string // название структуры EntityNameLowercase string // название структуры в нижнем регистре EntityNameUppercase string // название структуры с большой буквы EntityFirstLetter string // первая буква имени структуры }
структура с данными для заполнения шаблона
Click to show internal directories.
Click to hide internal directories.