cmd

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version means the version of reverse
	Version = "0.1+dev"
)

Functions

func Execute

func Execute() error

Execute represnets execute command

func GetPackageName

func GetPackageName(Path string) (string, error)

GetPackageName 通过实际路径,得到包名

func ModelCodeFileCreate added in v1.1.0

func ModelCodeFileCreate(templatePath, targePath string) error

Types

type ReverseConfig

type ReverseConfig struct {
	Kind    string          `yaml:"kind"`
	Name    string          `yaml:"name"`
	Source  ReverseSource   `yaml:"source"`
	Targets []ReverseTarget `yaml:"targets"`
}

ReverseConfig represents a reverse configuration

type ReverseSource

type ReverseSource struct {
	Database string `yaml:"database"`
	ConnStr  string `yaml:"conn_str"`
}

ReverseSource represents a reverse source which should be a database connection

type ReverseTarget

type ReverseTarget struct {
	Type              string   `yaml:"type"`
	IncludeTables     []string `yaml:"include_tables"`
	ExcludeTables     []string `yaml:"exclude_tables"`
	TableMapper       string   `yaml:"table_mapper"`
	ColumnMapper      string   `yaml:"column_mapper"`
	TemplatePath      string   `yaml:"template_path"`
	ModelTemplatePath string   `yaml:"model_template_path"`
	Template          string   `yaml:"template"`
	MultipleFiles     bool     `yaml:"multiple_files"`
	OutputDir         string   `yaml:"output_dir"`
	TablePrefix       string   `yaml:"table_prefix"`
	Language          string   `yaml:"language"`
	TableName         bool     `yaml:"table_name"`

	Funcs     map[string]string `yaml:"funcs"`
	Formatter string            `yaml:"formatter"`
	Importter string            `yaml:"importter"`
	ExtName   string            `yaml:"ext_name"`
}

ReverseTarget represents a reverse target

Jump to

Keyboard shortcuts

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