command

package
v0.13.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildVersion

func BuildVersion() string

func CloseDB

func CloseDB(db *gorm.DB) error

func InitFlagSetForConfig

func InitFlagSetForConfig(s *pflag.FlagSet, cc *Config)

func NewDB

func NewDB(c DbConfig) (*gorm.DB, string, error)

func NewDriver

func NewDriver(c *DriverConfig) (driver.Driver, error)

func NewGithubClient

func NewGithubClient(accessToken string) *github.Client

func NewSqlite3

func NewSqlite3(string) gorm.Dialector

func WriteFile

func WriteFile(filename string, data []byte) error

WriteFile writes data to a file named by filename. If the file does not exist, WriteFile creates it and its upper level paths.

Types

type Config

type Config struct {
	ens.Option
	DisableCommentTag bool              `yaml:"disableCommentTag" json:"disableCommentTag"` // 禁用注释放入tag标签中
	HasColumn         bool              `yaml:"hasColumn" json:"hasColumn"`                 // 是否输出字段
	SkipColumns       []string          `yaml:"skipColumns" json:"skipColumns"`             // 忽略输出字段, 格式 table.column
	Package           string            `yaml:"package" json:"package"`                     // 包名
	Options           map[string]string `yaml:"options" json:"options"`                     // 选项
}

type DbConfig

type DbConfig struct {
	Dialect string `yaml:"dialect" json:"dialect" binding:"oneof=mysql sqlite3"` // mysql, sqlite3
	DSN     string `yaml:"dsn" json:"dsn"`
	Options string `yaml:"options" json:"options"` // Options ?号后面, 如果为空, 则为 charset=utf8mb4&parseTime=True&loc=Local&interpolateParams=True
}

DbConfig connect information

type DriverConfig

type DriverConfig struct {
	DB         *gorm.DB
	Dialect    string
	DbName     string
	TableNames []string
}

type RootCmd

type RootCmd struct {
	// contains filtered or unexported fields
}

func NewRootCmd

func NewRootCmd() *RootCmd

func (*RootCmd) Execute

func (r *RootCmd) Execute() error

Execute adds all child commands to the root command and sets flags appropriately.

Jump to

Keyboard shortcuts

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