types

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MockSQLite = "sqlite"
	MockDocker = "docker"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int
const (
	SQL Mode = iota
	GORM
	XORM
	SQLX
	BUN
)

type RunArg

type RunArg struct {
	// DSN 数据库连接字符串
	DSN string `yaml:"dsn"`
	// Filename SQL文件模式
	Filename []string `yaml:"filename"`
	// Table 要生成的表名模式
	Table []string `yaml:"table"`
	// Mode 生成模式(仅用于命令行)
	Mode Mode `yaml:"-"`
	// Output 适配器输出目录
	Output string `yaml:"output"`
	// EntityOutput 实体输出目录
	EntityOutput string `yaml:"entity_output"`
	// RepoOutput 仓库接口输出目录
	RepoOutput string `yaml:"repo_output"`
	// RepoPackage 仓库接口包名
	RepoPackage string `yaml:"repo_package"`
	// EntityPackage 实体包名
	EntityPackage string `yaml:"entity_package"`
	// AutoAudit 是否开启自动审计
	AutoAudit bool `yaml:"auto_audit"`
	// MockTypes 要生成的 mock 类型
	MockTypes []string `yaml:"mock_types"`
}

RunArg 代表运行参数,同时也用于配置文件的解析

func DefaultRunArg

func DefaultRunArg() RunArg

DefaultRunArg 返回默认运行参数

func LoadConfig

func LoadConfig(filename string) (*RunArg, error)

LoadConfig 从文件加载配置

Jump to

Keyboard shortcuts

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