setdb

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Description = "make a isXXXXValid function"
View Source
var Flags = []cli.Flag{

	cli.StringFlag{
		Name:  "type,t",
		Usage: "the variable type",
	},
	cli.StringFlag{
		Name:  "tag,g",
		Usage: "the tag name",
		Value: "setdb",
	},
	cli.StringFlag{
		Name:  "name,n",
		Usage: "the function `NAME`",
		Value: "SetSQL",
	},
	cli.StringFlag{
		Name:  "output,o",
		Usage: "output to `FILE`",
	},
	cli.StringFlag{
		Name:  "db",
		Usage: "specify the db type",
		Value: "sql.DB",
	},
	cli.StringSliceFlag{
		Name:  "import,i",
		Usage: "the requried imports",
	},
}
View Source
var Usage = "generate enum valid function"

Functions

func Action

func Action(c *cli.Context) error

Types

type Condition

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

condition

func (*Condition) InitFromTag

func (c *Condition) InitFromTag(tag string) bool

type Config

type Config struct {
	Name    string
	TagName string
	Output  string
	Input   string
	Type    string
	DBType  string
	Imports map[string]string
}

type Generator

type Generator struct {
	generator.Generator
	Conds []*Condition
}

Generator holds the state of the analysis. Primarily used to buffer the output for format.Source.

func NewGenerator

func NewGenerator() *Generator

func (*Generator) Generate

func (g *Generator) Generate(conf *Config) error

func (*Generator) PrepareTask

func (g *Generator) PrepareTask(conf *Config)

func (*Generator) Run

func (g *Generator) Run(conf *Config)

Jump to

Keyboard shortcuts

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