util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferOut

func BufferOut(node ast.Node) (string, error)

BufferOut parser ast node to SQL string

func GenerateDataItem

func GenerateDataItem(columnType string) interface{}

GenerateDataItem rand data interface with given type

func GenerateDataItemString

func GenerateDataItemString(columnType string) string

GenerateDataItemString rand data with given type

func GenerateDateItem

func GenerateDateItem() time.Time

GenerateDateItem generate date item

func GenerateFloatItem

func GenerateFloatItem() float64

GenerateFloatItem generate float item

func GenerateIntItem

func GenerateIntItem() int

GenerateIntItem generate int item

func GenerateRandDataItem

func GenerateRandDataItem() interface{}

GenerateRandDataItem rand data item with rand type

func GenerateStringItem

func GenerateStringItem() string

GenerateStringItem generate string item

func GenerateTiDBDateItem

func GenerateTiDBDateItem() tidbTypes.Time

GenerateTiDBDateItem generate date item

func GenerateTimestampItem

func GenerateTimestampItem() time.Time

GenerateTimestampItem generate timestamp item

func GetUUID

func GetUUID() string

GetUUID return uuid

func Info

func Info(a ...interface{})

Info ...

func MaxInt

func MaxInt(a, b int) int

MaxInt ...

func MinInt

func MinInt(a, b int) int

MinInt ...

func Rd

func Rd(n int) int

Rd same to rand.Intn

func RdBool

func RdBool() bool

RdBool ...

func RdCharset

func RdCharset() string

RdCharset rand charset

func RdColumnOptions

func RdColumnOptions(t string) (options []ast.ColumnOptionType)

RdColumnOptions for rand column option with given type

func RdDataLen

func RdDataLen(t string) int

RdDataLen rand data with given type

func RdDate

func RdDate() time.Time

RdDate rand date

func RdFloat64

func RdFloat64() float64

RdFloat64 rand float64

func RdRange

func RdRange(n, m int) int

RdRange rand int in range

func RdString

func RdString(length int) string

RdString rand string with given length

func RdStringChar

func RdStringChar(length int) string

RdStringChar rand string with given length, letter chars only

func RdTimestamp

func RdTimestamp() time.Time

RdTimestamp return same format as RdDate except rand range TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07'

func RdType

func RdType() string

RdType rand data type

func TimeMustParse

func TimeMustParse(layout, value string) time.Time

TimeMustParse wrap time.Parse and panic when error

func Type2Tp

func Type2Tp(t string) byte

Type2Tp conver type string to tp byte TODO: complete conversion map

Types

This section is empty.

Jump to

Keyboard shortcuts

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