gen

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamingLower = "lower"
	NamingCamel = "camel"
	NamingSnake = "snake"
)

Variables

View Source
var ErrCircleQuery = errors.New("circle query with other fields")

Functions

func Clean added in v1.0.22

func Clean() error

func GenTemplates added in v1.0.22

func GenTemplates(_ *cli.Context) error

func GetCategory added in v1.0.22

func GetCategory() string

func NewDefaultGenerator added in v1.0.4

func NewDefaultGenerator(source, dir, namingStyle string, opt ...Option) *defaultGenerator

func RevertTemplate added in v1.0.22

func RevertTemplate(name string) error

func Update added in v1.0.22

func Update(category string) error

Types

type Key

type Key struct {
	VarExpression     string // cacheUserIdPrefix = "cache#User#id#"
	Left              string // cacheUserIdPrefix
	Right             string // cache#user#id#
	Variable          string // userIdKey
	KeyExpression     string // userIdKey: = fmt.Sprintf("cache#user#id#%v", userId)
	DataKeyExpression string // userIdKey: = fmt.Sprintf("cache#user#id#%v", data.userId)
	RespKeyExpression string // userIdKey: = fmt.Sprintf("cache#user#id#%v", resp.userId)
}

tableName:user {{prefix}}=cache key:id

type Option added in v1.0.4

type Option func(generator *defaultGenerator)

func WithConsoleOption added in v1.0.4

func WithConsoleOption(c console.Console) Option

type Table added in v1.0.4

type Table struct {
	parser.Table
	CacheKey          map[string]Key
	ContainsUniqueKey bool
}

Jump to

Keyboard shortcuts

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