Documentation ¶
Index ¶
- Constants
- Variables
- type Common
- func (o *Common) BuildModule(command *console.Command) (err error)
- func (o *Common) BuildScript(command *console.Command) string
- func (o *Common) FormatColumn(command *console.Command, table *base.Table, column *base.Column, ...)
- func (o *Common) FormatTable(command *console.Command, table *base.Table)
- func (o *Common) FormatTableAsModel(table *base.Table)
- func (o *Common) FormatTableAsService(table *base.Table)
- func (o *Common) ListTable(ctx context.Context, command *console.Command, addColumnPkg bool) (tables []*base.Table, err error)
- func (o *Common) ReadBaseDir(command *console.Command, key, value string) (err error)
- func (o *Common) ReadDsn(command *console.Command, key string) (err error)
- func (o *Common) ReadExport(command *console.Command, key string) (err error)
- func (o *Common) ReadModelPath(command *console.Command, key, value string) (err error)
- func (o *Common) ReadOverride(command *console.Command, key string) (err error)
- func (o *Common) ReadPrefix(command *console.Command, key string) (err error)
- func (o *Common) ReadTargetPath(command *console.Command, key, value string) (err error)
- func (o *Common) RegisterDatabase() error
Constants ¶
View Source
const DsnKey = "_gen:commands_"
Variables ¶
View Source
var RegexMatchPkg = regexp.MustCompile(`([_a-zA-Z0-9]+)$`)
Functions ¶
This section is empty.
Types ¶
type Common ¶
type Common struct { BaseDir string Dsn string Export, Prefix string ModelPath, ModelPkg string Override bool TargetPath, TargetPkg string ModuleName, ModuleFolder string }
func (*Common) BuildModule ¶
BuildModule build module name and working relative folder.
func (*Common) BuildScript ¶
BuildScript build command runner script.
func (*Common) FormatColumn ¶ added in v1.0.4
func (*Common) FormatTable ¶ added in v1.0.4
func (*Common) FormatTableAsModel ¶ added in v1.0.4
func (*Common) FormatTableAsService ¶ added in v1.0.4
func (*Common) ListTable ¶
func (o *Common) ListTable(ctx context.Context, command *console.Command, addColumnPkg bool) (tables []*base.Table, err error)
ListTable returns a list for tables in a database.
func (*Common) ReadBaseDir ¶
ReadBaseDir read absolute path of the application.
func (*Common) ReadExport ¶
ReadExport read export names.
func (*Common) ReadModelPath ¶
ReadModelPath read path for model files location.
func (*Common) ReadOverride ¶
ReadOverride read override state for existing files.
func (*Common) ReadPrefix ¶
ReadPrefix read prefix for table name.
func (*Common) ReadTargetPath ¶
ReadTargetPath read path for generated files save to.
func (*Common) RegisterDatabase ¶
RegisterDatabase adds a database connect configuration.
Click to show internal directories.
Click to hide internal directories.