pluginTestData

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MysqlCreateTalbeSQL = "" /* 1566-byte string literal not displayed */

Functions

func GetRandomString

func GetRandomString(l int, cn int) string

Types

type Column

type Column struct {
	ColumnName             string
	ColumnKey              string
	ColumnDefault          string
	DataType               string
	Extra                  string
	ColumnType             string
	CharacterSetName       string
	CollationName          string
	NumbericScale          int
	IsBool                 bool
	Unsigned               bool
	IsPrimary              bool
	AutoIncrement          bool
	EnumValues             []string
	SetValues              []string
	CharacterMaximumLength int
	NumbericPrecision      int
	Value                  interface{}
}

type DataStruct

type DataStruct struct {
	Id                      uint32 `json:"id"`
	Test_unsinged_bigint    uint64 `json:"test_unsinged_bigint"`
	Test_unsinged_int       uint32 `json:"test_unsinged_int"`
	Test_unsinged_mediumint uint32 `json:"test_unsinged_mediumint"`
	Test_unsinged_smallint  uint16 `json:"test_unsinged_smallint"`
	Test_unsinged_tinyint   uint8  `json:"test_unsinged_tinyint"`

	Testtinyint   int8  `json:"testtinyint"`
	Testsmallint  int16 `json:"testsmallint"`
	Testmediumint int32 `json:"testmediumint"`
	Testint       int32 `json:"testint"`
	Testbigint    int64 `json:"testbigint"`

	Testbit  int64 `json:"testbit"`
	Testbool bool  `json:"testbool"`

	Testvarchar string `json:"testvarchar"`
	Testchar    string `json:"testchar"`

	Testtime      string `json:"testtime"`
	Testdate      string `json:"testdate"`
	Testyear      string `json:"testyear"`
	Testtimestamp string `json:"testtimestamp"`
	Testdatetime  string `json:"testdatetime"`

	Testfloat   float32 `json:"testfloat"`
	Testdouble  float64 `json:"testdouble"`
	Testdecimal string  `json:"testdecimal"`

	Testtext       string `json:"testtext"`
	Testblob       string `json:"testblob"`
	Testmediumblob string `json:"testmediumblob"`
	Testlongblob   string `json:"testlongblob"`
	Testtinyblob   string `json:"testtinyblob"`

	Testenum string   `json:"testenum"`
	Testset  []string `json:"testset"`
}

type Event

type Event struct {
	Schema           string
	Talbe            string
	AutoIncrementNum uint64    //自增字段值
	ColumnList       []*Column //字段属性列表
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent() *Event

func (*Event) CheckData

func (This *Event) CheckData(src map[string]interface{}, destJsonString string) (map[string][]string, error)

func (*Event) CheckData0

func (This *Event) CheckData0(srcV interface{}, destV interface{}, key string, result map[string][]string)

func (*Event) CheckData2

func (This *Event) CheckData2(src map[string]interface{}, destJsonString string) (map[string][]string, error)

func (*Event) GetDataMap

func (This *Event) GetDataMap() map[uint64]map[string]interface{}

获取所有生成的数据结果

func (*Event) GetPri added in v1.2.2

func (This *Event) GetPri() []*string

func (*Event) GetTestDeleteData

func (This *Event) GetTestDeleteData() *pluginDriver.PluginDataType

func (*Event) GetTestInsertData

func (This *Event) GetTestInsertData() *pluginDriver.PluginDataType

func (*Event) GetTestQueryData

func (This *Event) GetTestQueryData() *pluginDriver.PluginDataType

func (*Event) GetTestUpdateData

func (This *Event) GetTestUpdateData() *pluginDriver.PluginDataType

func (*Event) SetIdVal

func (This *Event) SetIdVal(val interface{}) *Event

设置随机生成数据的id值

func (*Event) SetIsNull

func (This *Event) SetIsNull(b bool) *Event

设置是否生成null值的数据

func (*Event) SetSaveHistory

func (This *Event) SetSaveHistory(b bool) *Event

设置是否要保存历史数据

func (*Event) SetSchema

func (This *Event) SetSchema(name string) *Event

func (*Event) SetTable

func (This *Event) SetTable(name string) *Event

type EventType

type EventType int8
const (
	RANDALL   EventType = -1
	INSERT    EventType = 0
	UPDATE    EventType = 1
	DELETE    EventType = 2
	SQLTYPE   EventType = 3
	COMMIT    EventType = 4
	OTHERTYPE EventType = 5
)

type Plugin

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

func NewPlugin

func NewPlugin(name string, url string) *Plugin

func (*Plugin) DoTestStart

func (This *Plugin) DoTestStart(n uint) error

func (*Plugin) DoTestStartForSpeed

func (This *Plugin) DoTestStartForSpeed(n uint) error

用于性能测试。必须指定eventType,不支持debug

func (*Plugin) SetDebug

func (This *Plugin) SetDebug(b bool)

func (*Plugin) SetEventType

func (This *Plugin) SetEventType(eventType EventType)

func (*Plugin) SetParam

func (This *Plugin) SetParam(m map[string]interface{}) error

Jump to

Keyboard shortcuts

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