codegen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCrudSql

func GenerateCrudSql(data interface{}, pathTarget int, tag string) error

func ReadConfig

func ReadConfig() (string, error)

Types

type CodeGen

type CodeGen struct {
	Content    []byte `default:""""`
	FileName   string
	PathTarget int
}

type IYmlConfig

type IYmlConfig interface {
	ReadVerifyVersionYml(filePath string) (*YmlConfig, error)
	GenerateCrudSqlYml(data interface{}, pathTarget int, tag string) error
	WriteCrudSql() error
	CheckDirectoryQueriesValuePathYmlV1() error
	CreateDirectoryQueriesSQLV1() error
	CheckDirectoryQueriesValuePathYmlV2() error
	CreateDirectoryQueriesSQLV2() error
}

type YmlConfig

type YmlConfig struct {
	Version     string `yaml:"version"`
	CodeGen     CodeGen
	YmlVersion1 *YmlVersion1
	YmlVersion2 *YmlVersion2
}

func NewYmlConfig

func NewYmlConfig() *YmlConfig

func (*YmlConfig) CheckDirectoryQueriesValuePathYmlV1

func (ymlConfig *YmlConfig) CheckDirectoryQueriesValuePathYmlV1() error

func (*YmlConfig) CheckDirectoryQueriesValuePathYmlV2

func (ymlConfig *YmlConfig) CheckDirectoryQueriesValuePathYmlV2() error

func (*YmlConfig) CreateDirectoryQueriesSQLV1

func (ymlConfig *YmlConfig) CreateDirectoryQueriesSQLV1() error

func (*YmlConfig) CreateDirectoryQueriesSQLV2

func (ymlConfig *YmlConfig) CreateDirectoryQueriesSQLV2() error

func (*YmlConfig) GenerateCrudSqlYml

func (ymlConfig *YmlConfig) GenerateCrudSqlYml(data interface{}, pathTarget int, tag string) error

func (*YmlConfig) ReadVerifyVersionYml

func (ymlConfig *YmlConfig) ReadVerifyVersionYml(filePath string) (*YmlConfig, error)

func (*YmlConfig) WriteCrudSql

func (ymlConfig *YmlConfig) WriteCrudSql() error

type YmlVersion1

type YmlVersion1 struct {
	Package []struct {
		Name    string `yaml:"name"`
		Engine  string `yaml:"engine"`
		Queries string `yaml:"queries"`
		Schema  string `yaml:"schema"`
	} `yaml:"packages"`
}

func ReadYmlVersion1

func ReadYmlVersion1(content []byte) (*YmlVersion1, error)

type YmlVersion2

type YmlVersion2 struct {
	SQL []struct {
		Engine  string `yaml:"engine"`
		Queries string `yaml:"queries"`
		Schema  string `yaml:"schema"`
	} `yaml:"sql"`
}

func ReadYmlVersion2

func ReadYmlVersion2(content []byte) (*YmlVersion2, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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