Documentation
¶
Index ¶
- Variables
- func GenerateValByTemplate(templateName string) string
- func IsValidTemplateName(templateName string) bool
- type BPChar
- type BPChars
- type BaseType
- type Bit
- type Bits
- type Bool
- type Bools
- type Box
- type Boxes
- type ByteA
- type ByteAs
- type CIDR
- type CIDRs
- type CiText
- type Circle
- type Circles
- type Column
- type Date
- type Dates
- type Enum
- type EnumVal
- type EnumVals
- type Float4
- type Float4s
- type Float8
- type Float8s
- type INet
- type INets
- type Int2
- type Int2s
- type Int4
- type Int4s
- type Int8
- type Int8s
- type JSON
- type JSONB
- type JSONBs
- type JSONs
- type LSeg
- type LSegs
- type Line
- type Lines
- type MXMocker
- func (m *MXMocker) AsyncMock(length int)
- func (m *MXMocker) ExcludeColumn(names ...string)
- func (m *MXMocker) FakeAutoIncrementColumn()
- func (m *MXMocker) IgnoreAutoIncrementColumn()
- func (m *MXMocker) Mock(length int) [][]string
- func (m *MXMocker) MockBatch(lines, values int) ([][]string, error)
- func (m *MXMocker) MockBatchRow(keys ...string) []string
- func (m *MXMocker) MockBatchWithTotalValues(lines, totalValues int) ([][]string, error)
- func (m *MXMocker) MockRow() []string
- type MacAddr
- type MacAddrs
- type Money
- type Moneys
- type NewFunc
- type Numeric
- type Numerics
- type Oid
- type Path
- type Paths
- type PgLsn
- type PgLsns
- type Point
- type Points
- type Polygon
- type Polygons
- type TSQueries
- type TSQuery
- type TSVector
- type TSVectors
- type Text
- type Texts
- type Time
- type TimeTZ
- type TimeTZs
- type Times
- type Timestamp
- type TimestampTZ
- type TimestampTZs
- type Timestamps
- type TxidSnapshot
- type TxidSnapshots
- type Type
- func NewBPChar(colName string) Type
- func NewBPChars(colName string) Type
- func NewBit(colName string) Type
- func NewBits(colName string) Type
- func NewBool(colName string) Type
- func NewBools(colName string) Type
- func NewBox(colName string) Type
- func NewBoxes(colName string) Type
- func NewByteA(colName string) Type
- func NewByteAs(colName string) Type
- func NewCIDR(colName string) Type
- func NewCIDRs(colName string) Type
- func NewCircle(colName string) Type
- func NewCircles(colName string) Type
- func NewDate(colName string) Type
- func NewDates(colName string) Type
- func NewFloat4(colName string) Type
- func NewFloat4s(colName string) Type
- func NewFloat8(colName string) Type
- func NewFloat8s(colName string) Type
- func NewINet(colName string) Type
- func NewINets(colName string) Type
- func NewInt2(colName string) Type
- func NewInt2s(colName string) Type
- func NewInt4(colName string) Type
- func NewInt4s(colName string) Type
- func NewInt8(colName string) Type
- func NewInt8s(colName string) Type
- func NewJSON(colName string) Type
- func NewJSONs(colName string) Type
- func NewMacAddr(colName string) Type
- func NewMacAddrs(colName string) Type
- func NewMoney(colName string) Type
- func NewMoneys(colName string) Type
- func NewNumeric(colName string) Type
- func NewNumerics(colName string) Type
- func NewOid(colName string) Type
- func NewPgLsn(colName string) Type
- func NewPgLsns(colName string) Type
- func NewPoint(colName string) Type
- func NewPoints(colName string) Type
- func NewTSQueries(colName string) Type
- func NewTSQuery(colName string) Type
- func NewText(colName string) Type
- func NewTexts(colName string) Type
- func NewTime(colName string) Type
- func NewTimeTZ(colName string) Type
- func NewTimeTZs(colName string) Type
- func NewTimes(colName string) Type
- func NewTimestamp(colName string) Type
- func NewTimestampTZ(colName string) Type
- func NewTimestampTZs(colName string) Type
- func NewTimestamps(colName string) Type
- func NewTsVector(colName string) Type
- func NewTsVectors(colName string) Type
- func NewTxidSnapshot(colName string) Type
- func NewTxidSnapshots(colName string) Type
- func NewUUID(colName string) Type
- func NewUUIDs(colName string) Type
- func NewVarChar(colName string) Type
- func NewVarChars(colName string) Type
- func NewXML(colName string) Type
- func NewXMLs(colName string) Type
- type UUID
- type UUIDs
- type ValueRange
- type VarBit
- type VarBits
- type VarChar
- type VarChars
- type XML
- type XMLs
Constants ¶
This section is empty.
Variables ¶
View Source
var TypMap = map[string]NewFunc{ "int2": NewInt2, "int4": NewInt4, "_int2": NewInt2s, "_int4": NewInt4s, "int8": NewInt8, "_int8": NewInt8s, "oid": NewOid, "float4": NewFloat4, "_float4": NewFloat4s, "float8": NewFloat8, "_float8": NewFloat8s, "numeric": NewNumeric, "_numeric": NewNumerics, "money": NewMoney, "_money": NewMoneys, "bit": NewBit, "_bit": NewBits, "varbit": NewBit, "_varbit": NewBits, "bpchar": NewBPChar, "_bpchar": NewBPChars, "varchar": NewVarChar, "_varchar": NewVarChars, "bool": NewBool, "_bool": NewBools, "text": NewText, "_text": NewTexts, "inet": NewINet, "_inet": NewINets, "cidr": NewCIDR, "_cidr": NewCIDRs, "time": NewTime, "_time": NewTimes, "interval": NewTime, "_interval": NewTimes, "date": NewDate, "_date": NewDates, "timetz": NewTimeTZ, "_timetz": NewTimeTZs, "timestamp": NewTimestamp, "_timestamp": NewTimestamps, "timestamptz": NewTimestampTZ, "_timestamptz": NewTimestampTZs, "box": NewBox, "_box": NewBoxes, "circle": NewCircle, "_circle": NewCircles, "line": NewBox, "_line": NewBoxes, "lseg": NewBox, "_lseg": NewBoxes, "path": NewBox, "_path": NewBoxes, "polygon": NewBox, "_polygon": NewBoxes, "point": NewPoint, "_point": NewPoints, "json": NewJSON, "_json": NewJSONs, "jsonb": NewJSON, "_jsonb": NewJSONs, "xml": NewXML, "_xml": NewXMLs, "macaddr": NewMacAddr, "_macaddr": NewMacAddrs, "tsquery": NewTSQuery, "_tsquery": NewTSQueries, "tsvector": NewTsVector, "_tsvector": NewTsVectors, "uuid": NewUUID, "_uuid": NewUUIDs, "bytea": NewByteA, "_bytea": NewByteAs, "pg_lsn": NewPgLsn, "_pg_lsn": NewPgLsns, "txid_snapshot": NewTxidSnapshot, "_txid_snapshot": NewTxidSnapshots, }
Functions ¶
func GenerateValByTemplate ¶
func IsValidTemplateName ¶
Types ¶
type BPChar ¶
func (*BPChar) ValueRange ¶
func (bp *BPChar) ValueRange() map[string]*ValueRange
type BPChars ¶
type BPChars struct {
BaseType
// contains filtered or unexported fields
}
func (*BPChars) ValueRange ¶
func (bps *BPChars) ValueRange() map[string]*ValueRange
type BaseType ¶
type BaseType struct {
// contains filtered or unexported fields
}
func NewBaseType ¶
func (*BaseType) BracketsExists ¶
If given a typedesc see if it has a bracket or not.
func (*BaseType) FloatPrecision ¶
Extract Float precision from the float typedesc
func (*BaseType) GetColName ¶
type Bit ¶
func (*Bit) ValueRange ¶
func (b *Bit) ValueRange() map[string]*ValueRange
type Bits ¶
type Bits struct {
BaseType
// contains filtered or unexported fields
}
func (*Bits) ValueRange ¶
func (b *Bits) ValueRange() map[string]*ValueRange
type Bool ¶
type Bool struct {
BaseType
}
func (*Bool) ValueRange ¶
func (b *Bool) ValueRange() map[string]*ValueRange
type Bools ¶
type Bools struct {
BaseType
// contains filtered or unexported fields
}
func (*Bools) ValueRange ¶
func (bs *Bools) ValueRange() map[string]*ValueRange
type Box ¶
type Box struct {
BaseType
}
func (*Box) ValueRange ¶
func (b *Box) ValueRange() map[string]*ValueRange
type Boxes ¶
type Boxes struct {
BaseType
// contains filtered or unexported fields
}
func (Boxes) ValueRange ¶
func (bs Boxes) ValueRange() map[string]*ValueRange
type ByteA ¶
type ByteA struct {
BaseType
}
func (*ByteA) ValueRange ¶
func (b *ByteA) ValueRange() map[string]*ValueRange
type ByteAs ¶
type ByteAs struct {
BaseType
// contains filtered or unexported fields
}
func (*ByteAs) ValueRange ¶
func (bs *ByteAs) ValueRange() map[string]*ValueRange
type CIDR ¶
type CIDR struct {
BaseType
}
func (*CIDR) ValueRange ¶
func (c *CIDR) ValueRange() map[string]*ValueRange
type CIDRs ¶
type CIDRs struct {
BaseType
// contains filtered or unexported fields
}
func (*CIDRs) ValueRange ¶
func (cs *CIDRs) ValueRange() map[string]*ValueRange
type Circle ¶
type Circle struct {
BaseType
}
func (*Circle) ValueRange ¶
func (c *Circle) ValueRange() map[string]*ValueRange
type Circles ¶
type Circles struct {
BaseType
// contains filtered or unexported fields
}
func (Circles) ValueRange ¶
func (cs Circles) ValueRange() map[string]*ValueRange
type Column ¶
type Column struct {
Name string `db:"attname"`
TypeName string `db:"typname"`
TypeDesc string `db:"typdesc"`
DefVal string `db:"defval"`
Comment string `db:"comment"`
Encoding string `db:"encoding"`
// contains filtered or unexported fields
}
func NewColumnsFromDB ¶
func (*Column) GetValueRange ¶
func (cs *Column) GetValueRange() map[string]*ValueRange
func (*Column) WithEncoding ¶
type Date ¶
type Date struct {
BaseType
}
func (*Date) ValueRange ¶
func (d *Date) ValueRange() map[string]*ValueRange
type Dates ¶
type Dates struct {
BaseType
// contains filtered or unexported fields
}
func (*Dates) ValueRange ¶
func (ds *Dates) ValueRange() map[string]*ValueRange
type Enum ¶
type Enum struct {
BaseType
// contains filtered or unexported fields
}
func (*Enum) ValueRange ¶
func (e *Enum) ValueRange() map[string]*ValueRange
type Float4 ¶
type Float4 struct {
BaseType
}
func (*Float4) ValueRange ¶
func (f4 *Float4) ValueRange() map[string]*ValueRange
type Float4s ¶
type Float4s struct {
BaseType
// contains filtered or unexported fields
}
func (*Float4s) ValueRange ¶
func (f4s *Float4s) ValueRange() map[string]*ValueRange
type Float8 ¶
type Float8 struct {
BaseType
}
func (*Float8) ValueRange ¶
func (f8 *Float8) ValueRange() map[string]*ValueRange
type Float8s ¶
type Float8s struct {
BaseType
// contains filtered or unexported fields
}
func (*Float8s) ValueRange ¶
func (f8s *Float8s) ValueRange() map[string]*ValueRange
type INet ¶
type INet struct {
BaseType
}
func (*INet) ValueRange ¶
func (i *INet) ValueRange() map[string]*ValueRange
type INets ¶
type INets struct {
BaseType
// contains filtered or unexported fields
}
func (*INets) ValueRange ¶
func (is *INets) ValueRange() map[string]*ValueRange
type Int2 ¶
type Int2 struct {
BaseType
}
func (*Int2) ValueRange ¶
func (i2 *Int2) ValueRange() map[string]*ValueRange
type Int2s ¶
type Int2s struct {
BaseType
// contains filtered or unexported fields
}
func (*Int2s) ValueRange ¶
func (i2s *Int2s) ValueRange() map[string]*ValueRange
type Int4 ¶
type Int4 struct {
BaseType
}
func (*Int4) ValueRange ¶
func (i4 *Int4) ValueRange() map[string]*ValueRange
type Int4s ¶
type Int4s struct {
BaseType
// contains filtered or unexported fields
}
func (*Int4s) ValueRange ¶
func (i4s *Int4s) ValueRange() map[string]*ValueRange
type Int8 ¶
type Int8 struct {
BaseType
}
func (*Int8) ValueRange ¶
func (i8 *Int8) ValueRange() map[string]*ValueRange
type Int8s ¶
type Int8s struct {
BaseType
// contains filtered or unexported fields
}
func (*Int8s) ValueRange ¶
func (i8s *Int8s) ValueRange() map[string]*ValueRange
type JSON ¶
type JSON struct {
BaseType
Name string `json:"name"`
Age int `json:"number" fake:"{number:1,100}"`
}
func (*JSON) ValueRange ¶
func (j *JSON) ValueRange() map[string]*ValueRange
type JSONs ¶
type JSONs struct {
BaseType
// contains filtered or unexported fields
}
func (*JSONs) ValueRange ¶
func (js *JSONs) ValueRange() map[string]*ValueRange
type MXMocker ¶
type MXMocker struct {
RowCh chan []string
// contains filtered or unexported fields
}
*
- Mock data for YMatrix
func NewMXMockerFromColumns ¶
func (*MXMocker) ExcludeColumn ¶
func (*MXMocker) FakeAutoIncrementColumn ¶
func (m *MXMocker) FakeAutoIncrementColumn()
func (*MXMocker) IgnoreAutoIncrementColumn ¶
func (m *MXMocker) IgnoreAutoIncrementColumn()
func (*MXMocker) MockBatch ¶
Mock a batch of rows with ${lines} lines and every row has ${values} values
func (*MXMocker) MockBatchRow ¶
Mock one row belong a batch for current table
func (*MXMocker) MockBatchWithTotalValues ¶
Mock a batch of rows with ${lines} lines, with ${totalValues} non-empty values in total, with no overlapping non-empty values among lines
type MacAddr ¶
type MacAddr struct {
BaseType
}
func (*MacAddr) ValueRange ¶
func (m *MacAddr) ValueRange() map[string]*ValueRange
type MacAddrs ¶
type MacAddrs struct {
BaseType
// contains filtered or unexported fields
}
func (*MacAddrs) ValueRange ¶
func (ms *MacAddrs) ValueRange() map[string]*ValueRange
type Money ¶
type Money struct {
BaseType
}
func (*Money) ValueRange ¶
func (m *Money) ValueRange() map[string]*ValueRange
type Moneys ¶
type Moneys struct {
BaseType
// contains filtered or unexported fields
}
func (*Moneys) ValueRange ¶
func (ms *Moneys) ValueRange() map[string]*ValueRange
type Numeric ¶
func (*Numeric) ValueRange ¶
func (n *Numeric) ValueRange() map[string]*ValueRange
type Numerics ¶
type Numerics struct {
BaseType
// contains filtered or unexported fields
}
func (*Numerics) ValueRange ¶
func (ns *Numerics) ValueRange() map[string]*ValueRange
type Oid ¶
type Oid struct {
BaseType
}
func (*Oid) ValueRange ¶
func (id *Oid) ValueRange() map[string]*ValueRange
type PgLsn ¶
type PgLsn struct {
BaseType
}
func (*PgLsn) ValueRange ¶
func (p *PgLsn) ValueRange() map[string]*ValueRange
type PgLsns ¶
type PgLsns struct {
BaseType
// contains filtered or unexported fields
}
func (PgLsns) ValueRange ¶
func (ps PgLsns) ValueRange() map[string]*ValueRange
type Point ¶
type Point struct {
BaseType
}
func (*Point) ValueRange ¶
func (p *Point) ValueRange() map[string]*ValueRange
type Points ¶
type Points struct {
BaseType
// contains filtered or unexported fields
}
func (Points) ValueRange ¶
func (ps Points) ValueRange() map[string]*ValueRange
type TSQueries ¶
type TSQueries struct {
BaseType
// contains filtered or unexported fields
}
func (*TSQueries) ValueRange ¶
func (ts *TSQueries) ValueRange() map[string]*ValueRange
type TSQuery ¶
type TSQuery struct {
BaseType
}
func (*TSQuery) ValueRange ¶
func (t *TSQuery) ValueRange() map[string]*ValueRange
type TSVector ¶
type TSVector struct {
BaseType
}
func (*TSVector) ValueRange ¶
func (t *TSVector) ValueRange() map[string]*ValueRange
type TSVectors ¶
type TSVectors struct {
BaseType
// contains filtered or unexported fields
}
func (*TSVectors) ValueRange ¶
func (ts *TSVectors) ValueRange() map[string]*ValueRange
type Text ¶
type Text struct {
BaseType
}
func (*Text) ValueRange ¶
func (t *Text) ValueRange() map[string]*ValueRange
type Texts ¶
type Texts struct {
BaseType
// contains filtered or unexported fields
}
func (*Texts) ValueRange ¶
func (ts *Texts) ValueRange() map[string]*ValueRange
type Time ¶
type Time struct {
BaseType
}
func (*Time) ValueRange ¶
func (t *Time) ValueRange() map[string]*ValueRange
type TimeTZ ¶
type TimeTZ struct {
BaseType
}
func (*TimeTZ) ValueRange ¶
func (t *TimeTZ) ValueRange() map[string]*ValueRange
type TimeTZs ¶
type TimeTZs struct {
BaseType
// contains filtered or unexported fields
}
func (*TimeTZs) ValueRange ¶
func (ts *TimeTZs) ValueRange() map[string]*ValueRange
type Times ¶
type Times struct {
BaseType
// contains filtered or unexported fields
}
func (Times) ValueRange ¶
func (ts Times) ValueRange() map[string]*ValueRange
type Timestamp ¶
type Timestamp struct {
BaseType
}
func (*Timestamp) ValueRange ¶
func (t *Timestamp) ValueRange() map[string]*ValueRange
type TimestampTZ ¶
type TimestampTZ struct {
BaseType
}
func (*TimestampTZ) Random ¶
func (t *TimestampTZ) Random(keys ...string) string
func (*TimestampTZ) ValueRange ¶
func (t *TimestampTZ) ValueRange() map[string]*ValueRange
type TimestampTZs ¶
type TimestampTZs struct {
BaseType
// contains filtered or unexported fields
}
func (TimestampTZs) Parse ¶
func (ts TimestampTZs) Parse(string)
func (TimestampTZs) Random ¶
func (ts TimestampTZs) Random(keys ...string) string
func (*TimestampTZs) ValueRange ¶
func (ts *TimestampTZs) ValueRange() map[string]*ValueRange
type Timestamps ¶
type Timestamps struct {
BaseType
// contains filtered or unexported fields
}
func (Timestamps) Parse ¶
func (ts Timestamps) Parse(string)
func (Timestamps) Random ¶
func (ts Timestamps) Random(keys ...string) string
func (Timestamps) ValueRange ¶
func (ts Timestamps) ValueRange() map[string]*ValueRange
type TxidSnapshot ¶
type TxidSnapshot struct {
BaseType
}
func (*TxidSnapshot) Random ¶
func (t *TxidSnapshot) Random(keys ...string) string
func (*TxidSnapshot) ValueRange ¶
func (t *TxidSnapshot) ValueRange() map[string]*ValueRange
type TxidSnapshots ¶
type TxidSnapshots struct {
BaseType
// contains filtered or unexported fields
}
func (TxidSnapshots) Parse ¶
func (ts TxidSnapshots) Parse(string)
func (TxidSnapshots) Random ¶
func (ts TxidSnapshots) Random(keys ...string) string
func (*TxidSnapshots) ValueRange ¶
func (ts *TxidSnapshots) ValueRange() map[string]*ValueRange
type Type ¶
type Type interface {
// Fake a random value for keys belong current type
Random(keys ...string) string
// Parse typedesc to current type's field.
Parse(string)
// Keys of this type have
Keys() []string
// the value range of type, for example: "int2": {"min": 1, "max": "32767"}
ValueRange() map[string]*ValueRange
}
func NewBPChars ¶
func NewCircles ¶
func NewFloat4s ¶
func NewFloat8s ¶
func NewMacAddr ¶
func NewMacAddrs ¶
func NewNumeric ¶
func NewNumerics ¶
func NewTSQueries ¶
func NewTSQuery ¶
func NewTimeTZs ¶
func NewTimestamp ¶
func NewTimestampTZ ¶
func NewTimestampTZs ¶
func NewTimestamps ¶
func NewTsVector ¶
func NewTsVectors ¶
func NewTxidSnapshot ¶
func NewTxidSnapshots ¶
func NewVarChar ¶
func NewVarChars ¶
type UUID ¶
type UUID struct {
BaseType
}
func (*UUID) ValueRange ¶
func (u *UUID) ValueRange() map[string]*ValueRange
type UUIDs ¶
type UUIDs struct {
BaseType
// contains filtered or unexported fields
}
func (*UUIDs) ValueRange ¶
func (us *UUIDs) ValueRange() map[string]*ValueRange
type ValueRange ¶
type ValueRange struct {
Min interface{} `json:"min"`
Max interface{} `json:"max"`
}
type VarChar ¶
func (*VarChar) ValueRange ¶
func (v *VarChar) ValueRange() map[string]*ValueRange
type VarChars ¶
type VarChars struct {
BaseType
// contains filtered or unexported fields
}
func (*VarChars) ValueRange ¶
func (vs *VarChars) ValueRange() map[string]*ValueRange
Click to show internal directories.
Click to hide internal directories.