model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const NilFrequency = 10

NilFrequency ... nolint gomnd

View Source
const OneYear = int64(60 * 60 * 24 * 365)

OneYear ... nolint gomnd

Variables

This section is empty.

Functions

This section is empty.

Types

type DBSchema

type DBSchema interface {
	Tables() ([]Table, error)
	TableColumns(table string) ([]TableColumn, error)
	// CompatibleDs returns the dataSourceName from various the compatible format.
	CompatibleDs() string
	Pump(table string, rowsPumped chan<- RowsPumped, config PumpConfig, ready chan bool,
		onerr string, retryMaxTimes int) error
}

DBSchema ...

type PumpColumnConfig

type PumpColumnConfig struct {
}

PumpColumnConfig ...

type PumpConfig

type PumpConfig struct {
	ColumnsConfig map[string]PumpColumnConfig
	PumpMinRows   int
	PumpMaxRows   int
	BatchNum      int
}

PumpConfig ...

func (PumpConfig) RandRows

func (c PumpConfig) RandRows() int

RandRows ...

type Randomizer

type Randomizer interface {
	Value() interface{}
}

Randomizer ...

type RowsPumped

type RowsPumped struct {
	Table     string
	TotalRows int
	Rows      int
	Cost      time.Duration
	// contains filtered or unexported fields
}

RowsPumped ...

func MakeRowsPumped

func MakeRowsPumped(pumpTable string, totalRows int) *RowsPumped

MakeRowsPumped makes a new RowsPumped

func (*RowsPumped) Accumulate

func (p *RowsPumped) Accumulate(r RowsPumped)

Accumulate ...

type Table

type Table interface {
	GetName() string
	GetComment() string
}

Table abstract a table information.

type TableColumn

type TableColumn interface {
	// GetName get the column's name.
	GetName() string
	// GetComment get the column's comment.
	GetComment() string
	// GetDataType get the columns's data type
	GetDataType() string
	// GetMaxSize get the max size of the column
	GetMaxSize() int
	// IsNullable tells if the column is nullable or not
	IsNullable() bool
	// GetRandomizer returns the randomizer of the column
	GetRandomizer() Randomizer
	// GetCharacterSet returns the CharacterSet of the column
	GetCharacterSet() string
}

TableColumn describes a column in a table.

Jump to

Keyboard shortcuts

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