gen

package
v1.10.30 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Category

func Category() string

func Clean

func Clean() error

func GenTemplates

func GenTemplates(_ *cli.Context) error

func NewDefaultGenerator

func NewDefaultGenerator(dir string, cfg *config.Config, opt ...Option) (*defaultGenerator, error)

func RevertTemplate

func RevertTemplate(name string) error

func Update

func Update() 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

type Option func(generator *defaultGenerator)

func WithConsoleOption

func WithConsoleOption(c console.Console) Option

type Table

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