gen

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Category added in v1.1.1

func Category() string

func Clean added in v1.0.22

func Clean() error

func GenTemplates added in v1.0.22

func GenTemplates(_ *cli.Context) error

func NewDefaultGenerator added in v1.0.4

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

func RevertTemplate added in v1.0.22

func RevertTemplate(name string) error

func Update added in v1.0.22

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 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