gen

package
Version: v1.0.12-0...-16f252f Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewDefaultGenerator

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

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL