tbox

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2021 License: MIT Imports: 8 Imported by: 0

README

tbox

Model generation tool, which mainly generates mysql table 
as golang type, avoids the inconvenience caused by manual
operation, and facilitates project maintenance and expansion.

usage

go get -v github.com/daheige/tbox/cmd

go 1.16.x version
go install github.com/daheige/tbox/cmd

please see cmd/main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dsn string, opts ...Option) *engine

New create an entry for engine

func RegisterType

func RegisterType(mysqlType string, goType string)

RegisterType register mysql to to golang type

Types

type Option

type Option func(t *engine)

Option option for engine

func WithEnableJsonTag

func WithEnableJsonTag() Option

WithEnableJsonTag add json tab.

func WithEnableTableNameFunc

func WithEnableTableNameFunc() Option

WithEnableTableNameFunc generate TableName method.

func WithOutputCmd

func WithOutputCmd() Option

WithOutputCmd output struct to cmd

func WithPkgName

func WithPkgName(name string) Option

WithPkgName pkg name

func WithPkgPath

func WithPkgPath(pkgPath string) Option

WithPkgPath gen code to file dir path

func WithTagKey

func WithTagKey(tag string) Option

WithTagKey set field tag key

func WithUcFirstOnly

func WithUcFirstOnly() Option

WithUcFirstOnly first word upper.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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