mxmock

package
v0.0.0-...-ded41fa Latest Latest
Warning

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

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

Documentation

Index

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 GenerateValByTemplate(templateName string) string

func IsValidTemplateName

func IsValidTemplateName(templateName string) bool

Types

type BPChar

type BPChar struct {
	BaseType
	Length int
}

func (*BPChar) Parse

func (bp *BPChar) Parse(td string)

func (*BPChar) Random

func (bp *BPChar) Random(keys ...string) string

func (*BPChar) ValueRange

func (bp *BPChar) ValueRange() map[string]*ValueRange

type BPChars

type BPChars struct {
	BaseType
	// contains filtered or unexported fields
}

func (BPChars) Parse

func (bps BPChars) Parse(td string)

func (BPChars) Random

func (bps BPChars) Random(keys ...string) string

func (*BPChars) ValueRange

func (bps *BPChars) ValueRange() map[string]*ValueRange

type BaseType

type BaseType struct {
	// contains filtered or unexported fields
}

func NewBaseType

func NewBaseType(colName string) BaseType

func (*BaseType) BracketsExists

func (t *BaseType) BracketsExists(td string) bool

If given a typedesc see if it has a bracket or not.

func (*BaseType) CharLen

func (t *BaseType) CharLen(td string) (int, error)

Extract total characters that the typedesc char can store.

func (*BaseType) FloatPrecision

func (t *BaseType) FloatPrecision(td string) (int, int, error)

Extract Float precision from the float typedesc

func (*BaseType) GetColName

func (t *BaseType) GetColName() string

func (*BaseType) Keys

func (t *BaseType) Keys() []string

func (*BaseType) Parse

func (t *BaseType) Parse(string)

type Bit

type Bit struct {
	BaseType
	Length int
}

func (*Bit) Parse

func (b *Bit) Parse(td string)

func (*Bit) Random

func (b *Bit) Random(keys ...string) string

func (*Bit) ValueRange

func (b *Bit) ValueRange() map[string]*ValueRange

type Bits

type Bits struct {
	BaseType
	// contains filtered or unexported fields
}

func (Bits) Parse

func (bs Bits) Parse(td string)

func (Bits) Random

func (bs Bits) Random(keys ...string) string

func (*Bits) ValueRange

func (b *Bits) ValueRange() map[string]*ValueRange

type Bool

type Bool struct {
	BaseType
}

func (*Bool) Random

func (b *Bool) Random(keys ...string) string

func (*Bool) ValueRange

func (b *Bool) ValueRange() map[string]*ValueRange

type Bools

type Bools struct {
	BaseType
	// contains filtered or unexported fields
}

func (Bools) Parse

func (bs Bools) Parse(string)

func (Bools) Random

func (bs Bools) Random(keys ...string) string

func (*Bools) ValueRange

func (bs *Bools) ValueRange() map[string]*ValueRange

type Box

type Box struct {
	BaseType
}

func (*Box) Random

func (b *Box) Random(keys ...string) string

func (*Box) ValueRange

func (b *Box) ValueRange() map[string]*ValueRange

type Boxes

type Boxes struct {
	BaseType
	// contains filtered or unexported fields
}

func (Boxes) Parse

func (bs Boxes) Parse(string)

func (Boxes) Random

func (bs Boxes) Random(keys ...string) string

func (Boxes) ValueRange

func (bs Boxes) ValueRange() map[string]*ValueRange

type ByteA

type ByteA struct {
	BaseType
}

func (ByteA) Random

func (b ByteA) Random(keys ...string) string

func (*ByteA) ValueRange

func (b *ByteA) ValueRange() map[string]*ValueRange

type ByteAs

type ByteAs struct {
	BaseType
	// contains filtered or unexported fields
}

func (ByteAs) Parse

func (bs ByteAs) Parse(string)

func (ByteAs) Random

func (bs ByteAs) Random(keys ...string) string

func (*ByteAs) ValueRange

func (bs *ByteAs) ValueRange() map[string]*ValueRange

type CIDR

type CIDR struct {
	BaseType
}

func (*CIDR) Random

func (c *CIDR) Random(keys ...string) string

func (*CIDR) ValueRange

func (c *CIDR) ValueRange() map[string]*ValueRange

type CIDRs

type CIDRs struct {
	BaseType
	// contains filtered or unexported fields
}

func (CIDRs) Parse

func (cs CIDRs) Parse(string)

func (CIDRs) Random

func (cs CIDRs) Random(keys ...string) string

func (*CIDRs) ValueRange

func (cs *CIDRs) ValueRange() map[string]*ValueRange

type CiText

type CiText struct{}

TODO

type Circle

type Circle struct {
	BaseType
}

func (*Circle) Random

func (c *Circle) Random(keys ...string) string

func (*Circle) ValueRange

func (c *Circle) ValueRange() map[string]*ValueRange

type Circles

type Circles struct {
	BaseType
	// contains filtered or unexported fields
}

func (Circles) Parse

func (cs Circles) Parse(string)

func (Circles) Random

func (cs Circles) Random(keys ...string) string

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 NewColumnsFromDB(conn *sqlx.DB, schema, table string) ([]*Column, error)

func (*Column) GetValueRange

func (cs *Column) GetValueRange() map[string]*ValueRange

func (*Column) WithEncoding

func (cs *Column) WithEncoding(enc string) *Column

type Date

type Date struct {
	BaseType
}

func (*Date) Random

func (d *Date) Random(keys ...string) string

func (*Date) ValueRange

func (d *Date) ValueRange() map[string]*ValueRange

type Dates

type Dates struct {
	BaseType
	// contains filtered or unexported fields
}

func (Dates) Parse

func (ds Dates) Parse(string)

func (Dates) Random

func (ds Dates) Random(keys ...string) string

func (*Dates) ValueRange

func (ds *Dates) ValueRange() map[string]*ValueRange

type Enum

type Enum struct {
	BaseType
	// contains filtered or unexported fields
}

func NewEnum

func NewEnum(dt string, conn *sqlx.DB) (*Enum, error)

func (Enum) Random

func (e Enum) Random(keys ...string) string

func (*Enum) ValueRange

func (e *Enum) ValueRange() map[string]*ValueRange

type EnumVal

type EnumVal struct {
	Name   string `db:"enum_name"`
	Schema string `db:"enum_schema"`
	Value  string `db:"enum_value"`
}

type EnumVals

type EnumVals []*EnumVal

func (EnumVals) Val

func (vs EnumVals) Val() []string

type Float4

type Float4 struct {
	BaseType
}

func (*Float4) Random

func (f4 *Float4) Random(keys ...string) string

func (*Float4) ValueRange

func (f4 *Float4) ValueRange() map[string]*ValueRange

type Float4s

type Float4s struct {
	BaseType
	// contains filtered or unexported fields
}

func (Float4s) Parse

func (f4s Float4s) Parse(string)

func (Float4s) Random

func (f4s Float4s) Random(keys ...string) string

func (*Float4s) ValueRange

func (f4s *Float4s) ValueRange() map[string]*ValueRange

type Float8

type Float8 struct {
	BaseType
}

func (*Float8) Random

func (f8 *Float8) Random(keys ...string) string

func (*Float8) ValueRange

func (f8 *Float8) ValueRange() map[string]*ValueRange

type Float8s

type Float8s struct {
	BaseType
	// contains filtered or unexported fields
}

func (Float8s) Parse

func (f8s Float8s) Parse(string)

func (Float8s) Random

func (f8s Float8s) Random(keys ...string) string

func (*Float8s) ValueRange

func (f8s *Float8s) ValueRange() map[string]*ValueRange

type INet

type INet struct {
	BaseType
}

func (*INet) Random

func (i *INet) Random(keys ...string) string

func (*INet) ValueRange

func (i *INet) ValueRange() map[string]*ValueRange

type INets

type INets struct {
	BaseType
	// contains filtered or unexported fields
}

func (INets) Parse

func (is INets) Parse(string)

func (INets) Random

func (is INets) Random(keys ...string) string

func (*INets) ValueRange

func (is *INets) ValueRange() map[string]*ValueRange

type Int2

type Int2 struct {
	BaseType
}

func (*Int2) Random

func (i2 *Int2) Random(keys ...string) string

func (*Int2) ValueRange

func (i2 *Int2) ValueRange() map[string]*ValueRange

type Int2s

type Int2s struct {
	BaseType
	// contains filtered or unexported fields
}

func (Int2s) Parse

func (i2s Int2s) Parse(string)

func (Int2s) Random

func (i2s Int2s) Random(keys ...string) string

func (*Int2s) ValueRange

func (i2s *Int2s) ValueRange() map[string]*ValueRange

type Int4

type Int4 struct {
	BaseType
}

func (*Int4) Random

func (i4 *Int4) Random(keys ...string) string

func (*Int4) ValueRange

func (i4 *Int4) ValueRange() map[string]*ValueRange

type Int4s

type Int4s struct {
	BaseType
	// contains filtered or unexported fields
}

func (Int4s) Parse

func (i4s Int4s) Parse(string)

func (Int4s) Random

func (i4s Int4s) Random(keys ...string) string

func (*Int4s) ValueRange

func (i4s *Int4s) ValueRange() map[string]*ValueRange

type Int8

type Int8 struct {
	BaseType
}

func (*Int8) Random

func (i8 *Int8) Random(keys ...string) string

func (*Int8) ValueRange

func (i8 *Int8) ValueRange() map[string]*ValueRange

type Int8s

type Int8s struct {
	BaseType
	// contains filtered or unexported fields
}

func (Int8s) Parse

func (i8s Int8s) Parse(string)

func (Int8s) Random

func (i8s Int8s) Random(keys ...string) string

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

func (j *JSON) Random(keys ...string) string

func (*JSON) ValueRange

func (j *JSON) ValueRange() map[string]*ValueRange

type JSONB

type JSONB = JSON

type JSONBs

type JSONBs = JSONs

type JSONs

type JSONs struct {
	BaseType
	// contains filtered or unexported fields
}

func (JSONs) Parse

func (js JSONs) Parse(string)

func (JSONs) Random

func (js JSONs) Random(keys ...string) string

func (*JSONs) ValueRange

func (js *JSONs) ValueRange() map[string]*ValueRange

type LSeg

type LSeg = Box

type LSegs

type LSegs = Boxes

type Line

type Line = Box

type Lines

type Lines = Boxes

type MXMocker

type MXMocker struct {
	RowCh chan []string
	// contains filtered or unexported fields
}

*

  • Mock data for YMatrix

func NewMXMocker

func NewMXMocker(conn *sqlx.DB, schema, table string) (*MXMocker, error)

func NewMXMockerFromColumns

func NewMXMockerFromColumns(columns []*Column) (*MXMocker, error)

func (*MXMocker) AsyncMock

func (m *MXMocker) AsyncMock(length int)

func (*MXMocker) ExcludeColumn

func (m *MXMocker) ExcludeColumn(names ...string)

func (*MXMocker) FakeAutoIncrementColumn

func (m *MXMocker) FakeAutoIncrementColumn()

func (*MXMocker) IgnoreAutoIncrementColumn

func (m *MXMocker) IgnoreAutoIncrementColumn()

func (*MXMocker) Mock

func (m *MXMocker) Mock(length int) [][]string

func (*MXMocker) MockBatch

func (m *MXMocker) MockBatch(lines, values int) ([][]string, error)

Mock a batch of rows with ${lines} lines and every row has ${values} values

func (*MXMocker) MockBatchRow

func (m *MXMocker) MockBatchRow(keys ...string) []string

Mock one row belong a batch for current table

func (*MXMocker) MockBatchWithTotalValues

func (m *MXMocker) MockBatchWithTotalValues(lines, totalValues int) ([][]string, error)

Mock a batch of rows with ${lines} lines, with ${totalValues} non-empty values in total, with no overlapping non-empty values among lines

func (*MXMocker) MockRow

func (m *MXMocker) MockRow() []string

Mock one row for current table

type MacAddr

type MacAddr struct {
	BaseType
}

func (*MacAddr) Random

func (m *MacAddr) Random(keys ...string) string

func (*MacAddr) ValueRange

func (m *MacAddr) ValueRange() map[string]*ValueRange

type MacAddrs

type MacAddrs struct {
	BaseType
	// contains filtered or unexported fields
}

func (MacAddrs) Parse

func (ms MacAddrs) Parse(string)

func (MacAddrs) Random

func (ms MacAddrs) Random(keys ...string) string

func (*MacAddrs) ValueRange

func (ms *MacAddrs) ValueRange() map[string]*ValueRange

type Money

type Money struct {
	BaseType
}

func (*Money) Random

func (m *Money) Random(keys ...string) string

func (*Money) ValueRange

func (m *Money) ValueRange() map[string]*ValueRange

type Moneys

type Moneys struct {
	BaseType
	// contains filtered or unexported fields
}

func (Moneys) Parse

func (ms Moneys) Parse(string)

func (Moneys) Random

func (ms Moneys) Random(keys ...string) string

func (*Moneys) ValueRange

func (ms *Moneys) ValueRange() map[string]*ValueRange

type NewFunc

type NewFunc func(string) Type

type Numeric

type Numeric struct {
	BaseType
	Max       int
	Precision int
}

func (*Numeric) Parse

func (n *Numeric) Parse(td string)

func (*Numeric) Random

func (n *Numeric) Random(keys ...string) string

func (*Numeric) ValueRange

func (n *Numeric) ValueRange() map[string]*ValueRange

type Numerics

type Numerics struct {
	BaseType
	// contains filtered or unexported fields
}

func (Numerics) Parse

func (ns Numerics) Parse(td string)

func (Numerics) Random

func (ns Numerics) Random(keys ...string) string

func (*Numerics) ValueRange

func (ns *Numerics) ValueRange() map[string]*ValueRange

type Oid

type Oid struct {
	BaseType
}

func (*Oid) Random

func (id *Oid) Random(keys ...string) string

func (*Oid) ValueRange

func (id *Oid) ValueRange() map[string]*ValueRange

type Path

type Path = Box

type Paths

type Paths = Boxes

type PgLsn

type PgLsn struct {
	BaseType
}

func (*PgLsn) Random

func (p *PgLsn) Random(keys ...string) string

func (*PgLsn) ValueRange

func (p *PgLsn) ValueRange() map[string]*ValueRange

type PgLsns

type PgLsns struct {
	BaseType
	// contains filtered or unexported fields
}

func (PgLsns) Parse

func (ps PgLsns) Parse(string)

func (PgLsns) Random

func (ps PgLsns) Random(keys ...string) string

func (PgLsns) ValueRange

func (ps PgLsns) ValueRange() map[string]*ValueRange

type Point

type Point struct {
	BaseType
}

func (*Point) Random

func (p *Point) Random(keys ...string) string

func (*Point) ValueRange

func (p *Point) ValueRange() map[string]*ValueRange

type Points

type Points struct {
	BaseType
	// contains filtered or unexported fields
}

func (Points) Parse

func (ps Points) Parse(string)

func (Points) Random

func (ps Points) Random(keys ...string) string

func (Points) ValueRange

func (ps Points) ValueRange() map[string]*ValueRange

type Polygon

type Polygon = Box

type Polygons

type Polygons = Boxes

type TSQueries

type TSQueries struct {
	BaseType
	// contains filtered or unexported fields
}

func (TSQueries) Parse

func (ts TSQueries) Parse(string)

func (TSQueries) Random

func (ts TSQueries) Random(keys ...string) string

func (*TSQueries) ValueRange

func (ts *TSQueries) ValueRange() map[string]*ValueRange

type TSQuery

type TSQuery struct {
	BaseType
}

func (*TSQuery) Random

func (t *TSQuery) Random(keys ...string) string

func (*TSQuery) ValueRange

func (t *TSQuery) ValueRange() map[string]*ValueRange

type TSVector

type TSVector struct {
	BaseType
}

func (*TSVector) Random

func (t *TSVector) Random(keys ...string) string

func (*TSVector) ValueRange

func (t *TSVector) ValueRange() map[string]*ValueRange

type TSVectors

type TSVectors struct {
	BaseType
	// contains filtered or unexported fields
}

func (TSVectors) Parse

func (ts TSVectors) Parse(string)

func (TSVectors) Random

func (ts TSVectors) Random(keys ...string) string

func (*TSVectors) ValueRange

func (ts *TSVectors) ValueRange() map[string]*ValueRange

type Text

type Text struct {
	BaseType
}

func (*Text) Random

func (t *Text) Random(keys ...string) string

func (*Text) ValueRange

func (t *Text) ValueRange() map[string]*ValueRange

type Texts

type Texts struct {
	BaseType
	// contains filtered or unexported fields
}

func (Texts) Parse

func (ts Texts) Parse(string)

func (Texts) Random

func (ts Texts) Random(keys ...string) string

func (*Texts) ValueRange

func (ts *Texts) ValueRange() map[string]*ValueRange

type Time

type Time struct {
	BaseType
}

func (Time) Random

func (t Time) Random(keys ...string) string

func (*Time) ValueRange

func (t *Time) ValueRange() map[string]*ValueRange

type TimeTZ

type TimeTZ struct {
	BaseType
}

func (*TimeTZ) Random

func (t *TimeTZ) Random(keys ...string) string

func (*TimeTZ) ValueRange

func (t *TimeTZ) ValueRange() map[string]*ValueRange

type TimeTZs

type TimeTZs struct {
	BaseType
	// contains filtered or unexported fields
}

func (TimeTZs) Parse

func (ts TimeTZs) Parse(string)

func (TimeTZs) Random

func (ts TimeTZs) Random(keys ...string) string

func (*TimeTZs) ValueRange

func (ts *TimeTZs) ValueRange() map[string]*ValueRange

type Times

type Times struct {
	BaseType
	// contains filtered or unexported fields
}

func (Times) Parse

func (ts Times) Parse(string)

func (Times) Random

func (ts Times) Random(keys ...string) string

func (Times) ValueRange

func (ts Times) ValueRange() map[string]*ValueRange

type Timestamp

type Timestamp struct {
	BaseType
}

func (*Timestamp) Random

func (t *Timestamp) Random(keys ...string) string

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 NewBPChar

func NewBPChar(colName string) Type

func NewBPChars

func NewBPChars(colName string) Type

func NewBit

func NewBit(colName string) Type

func NewBits

func NewBits(colName string) Type

func NewBool

func NewBool(colName string) Type

func NewBools

func NewBools(colName string) Type

func NewBox

func NewBox(colName string) Type

func NewBoxes

func NewBoxes(colName string) Type

func NewByteA

func NewByteA(colName string) Type

func NewByteAs

func NewByteAs(colName string) Type

func NewCIDR

func NewCIDR(colName string) Type

func NewCIDRs

func NewCIDRs(colName string) Type

func NewCircle

func NewCircle(colName string) Type

func NewCircles

func NewCircles(colName string) Type

func NewDate

func NewDate(colName string) Type

func NewDates

func NewDates(colName string) Type

func NewFloat4

func NewFloat4(colName string) Type

func NewFloat4s

func NewFloat4s(colName string) Type

func NewFloat8

func NewFloat8(colName string) Type

func NewFloat8s

func NewFloat8s(colName string) Type

func NewINet

func NewINet(colName string) Type

func NewINets

func NewINets(colName string) Type

func NewInt2

func NewInt2(colName string) Type

func NewInt2s

func NewInt2s(colName string) Type

func NewInt4

func NewInt4(colName string) Type

func NewInt4s

func NewInt4s(colName string) Type

func NewInt8

func NewInt8(colName string) Type

func NewInt8s

func NewInt8s(colName string) Type

func NewJSON

func NewJSON(colName string) Type

func NewJSONs

func NewJSONs(colName string) Type

func NewMacAddr

func NewMacAddr(colName string) Type

func NewMacAddrs

func NewMacAddrs(colName string) Type

func NewMoney

func NewMoney(colName string) Type

func NewMoneys

func NewMoneys(colName string) Type

func NewNumeric

func NewNumeric(colName string) Type

func NewNumerics

func NewNumerics(colName string) Type

func NewOid

func NewOid(colName string) Type

func NewPgLsn

func NewPgLsn(colName string) Type

func NewPgLsns

func NewPgLsns(colName string) Type

func NewPoint

func NewPoint(colName string) Type

func NewPoints

func NewPoints(colName string) Type

func NewTSQueries

func NewTSQueries(colName string) Type

func NewTSQuery

func NewTSQuery(colName string) Type

func NewText

func NewText(colName string) Type

func NewTexts

func NewTexts(colName string) Type

func NewTime

func NewTime(colName string) Type

func NewTimeTZ

func NewTimeTZ(colName string) Type

func NewTimeTZs

func NewTimeTZs(colName string) Type

func NewTimes

func NewTimes(colName string) Type

func NewTimestamp

func NewTimestamp(colName string) Type

func NewTimestampTZ

func NewTimestampTZ(colName string) Type

func NewTimestampTZs

func NewTimestampTZs(colName string) Type

func NewTimestamps

func NewTimestamps(colName string) Type

func NewTsVector

func NewTsVector(colName string) Type

func NewTsVectors

func NewTsVectors(colName string) Type

func NewTxidSnapshot

func NewTxidSnapshot(colName string) Type

func NewTxidSnapshots

func NewTxidSnapshots(colName string) Type

func NewUUID

func NewUUID(colName string) Type

func NewUUIDs

func NewUUIDs(colName string) Type

func NewVarChar

func NewVarChar(colName string) Type

func NewVarChars

func NewVarChars(colName string) Type

func NewXML

func NewXML(colName string) Type

func NewXMLs

func NewXMLs(colName string) Type

type UUID

type UUID struct {
	BaseType
}

func (*UUID) Random

func (u *UUID) Random(keys ...string) string

func (*UUID) ValueRange

func (u *UUID) ValueRange() map[string]*ValueRange

type UUIDs

type UUIDs struct {
	BaseType
	// contains filtered or unexported fields
}

func (UUIDs) Parse

func (us UUIDs) Parse(string)

func (UUIDs) Random

func (us UUIDs) Random(keys ...string) string

func (*UUIDs) ValueRange

func (us *UUIDs) ValueRange() map[string]*ValueRange

type ValueRange

type ValueRange struct {
	Min interface{} `json:"min"`
	Max interface{} `json:"max"`
}

type VarBit

type VarBit = Bit

type VarBits

type VarBits = Bits

type VarChar

type VarChar struct {
	BaseType
	Length int
}

func (*VarChar) Parse

func (v *VarChar) Parse(td string)

func (*VarChar) Random

func (v *VarChar) Random(keys ...string) string

func (*VarChar) ValueRange

func (v *VarChar) ValueRange() map[string]*ValueRange

type VarChars

type VarChars struct {
	BaseType
	// contains filtered or unexported fields
}

func (VarChars) Parse

func (vs VarChars) Parse(td string)

func (VarChars) Random

func (vs VarChars) Random(keys ...string) string

func (*VarChars) ValueRange

func (vs *VarChars) ValueRange() map[string]*ValueRange

type XML

type XML struct {
	BaseType

	XMLName xml.Name `xml:"mxmock"`
	Name    string   `xml:"name,attr"`
	Age     int      `xml:"number" fake:"{number:1,100}"`
}

func (*XML) Random

func (x *XML) Random(keys ...string) string

func (*XML) ValueRange

func (x *XML) ValueRange() map[string]*ValueRange

type XMLs

type XMLs struct {
	BaseType
	// contains filtered or unexported fields
}

func (XMLs) Parse

func (xs XMLs) Parse(string)

func (XMLs) Random

func (xs XMLs) Random(keys ...string) string

func (*XMLs) ValueRange

func (xs *XMLs) ValueRange() map[string]*ValueRange

Jump to

Keyboard shortcuts

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