data

package
v0.2.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayGenerator

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

func (*ArrayGenerator) Next

func (g *ArrayGenerator) Next() interface{}

func (*ArrayGenerator) Type

func (g *ArrayGenerator) Type() spansql.TypeBase

type BooleanGenerator

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

func (*BooleanGenerator) Next

func (b *BooleanGenerator) Next() interface{}

func (*BooleanGenerator) Type

func (b *BooleanGenerator) Type() spansql.TypeBase

type CombinedGenerator

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

Generator is the interface that all data generators must satisfy

func NewCombinedGenerator

func NewCombinedGenerator(cfg CombinedGeneratorConfig) (*CombinedGenerator, error)

func (*CombinedGenerator) Next

func (s *CombinedGenerator) Next() interface{}

func (*CombinedGenerator) Type

type CombinedGeneratorConfig

type CombinedGeneratorConfig struct {
	PrefixLength int
	StringLength int
	Min          int
	Max          int
	KeyRange     *config.TableConfigGeneratorRange
}

Generator is the interface that all data generators must satisfy

type CompositeKey

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

Composite key returns a spanner key containing multiple static values

func (*CompositeKey) Next

func (g *CompositeKey) Next() interface{}

func (*CompositeKey) Type

func (g *CompositeKey) Type() spansql.TypeBase

type Config

type Config interface {
	Copy() Config
	SetBegin(interface{})
	Begin() interface{}
	SetEnd(interface{})
	End() interface{}
	SetLength(int)
	Length() int
	SetStatic(bool)
	Static() bool
	SetValue(interface{})
	Value() interface{}
	SetMinimum(interface{})
	Minimum() interface{}
	SetMaximum(interface{})
	Maximum() interface{}
	SetSource(rand.Source)
	Source() rand.Source
	SetRange(bool)
	Range() bool
	SetGenerator(Generator)
	Generator() Generator
	SetSpannerType(spansql.Type)
	SpannerType() spansql.Type
}

func NewConfig

func NewConfig() Config

type DateGenerator

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

func (*DateGenerator) Next

func (g *DateGenerator) Next() interface{}

func (*DateGenerator) Type

func (g *DateGenerator) Type() spansql.TypeBase

type DateGeneratorConfig

type DateGeneratorConfig struct {
	Source  rand.Source
	Range   bool // If true, only generate dates within min and max range
	Minimum time.Time
	Maximum time.Time
}

type Float64Generator

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

func (*Float64Generator) Next

func (g *Float64Generator) Next() interface{}

func (*Float64Generator) Type

func (g *Float64Generator) Type() spansql.TypeBase

type Generator

type Generator interface {
	Type() spansql.TypeBase
	Next() interface{}
}

Generator is the interface that all data generators must satisfy

func NewArrayGenerator

func NewArrayGenerator(cfg Config) (Generator, error)

func NewBooleanGenerator

func NewBooleanGenerator(cfg Config) (Generator, error)

func NewDateGenerator

func NewDateGenerator(cfg Config) (Generator, error)

func NewFloat64Generator

func NewFloat64Generator(cfg Config) (Generator, error)

func NewInt64Generator

func NewInt64Generator(cfg Config) (Generator, error)

func NewNumericGenerator

func NewNumericGenerator(cfg Config) (Generator, error)

func NewRandomByteGenerator

func NewRandomByteGenerator(cfg Config) (Generator, error)

func NewStaticBooleanGenerator

func NewStaticBooleanGenerator(cfg Config, vals []bool) (Generator, error)

func NewStaticBytesGenerator

func NewStaticBytesGenerator(cfg Config, vals [][]byte) (Generator, error)

func NewStaticDateGenerator

func NewStaticDateGenerator(cfg Config, vals []civil.Date) (Generator, error)

func NewStaticFloat64Generator

func NewStaticFloat64Generator(cfg Config, vals []float64) (Generator, error)

func NewStaticInt64Generator

func NewStaticInt64Generator(cfg Config, vals []int64) (Generator, error)

func NewStaticNumericGenerator

func NewStaticNumericGenerator(cfg Config, vals []*big.Rat) (Generator, error)

func NewStaticStringGenerator

func NewStaticStringGenerator(cfg Config, vals []string) (Generator, error)

func NewStaticTimestampGenerator

func NewStaticTimestampGenerator(cfg Config, vals []time.Time) (Generator, error)

func NewStringGenerator

func NewStringGenerator(cfg Config) (Generator, error)

func NewTimestampGenerator

func NewTimestampGenerator(cfg Config) (Generator, error)

type GeneratorMap

type GeneratorMap map[string]Generator

type HexavigesimalGenerator

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

func (*HexavigesimalGenerator) Decode

func (g *HexavigesimalGenerator) Decode(s string) uint64

Decode decodes a base26-encoded string back to uint64

func (*HexavigesimalGenerator) Encode

func (g *HexavigesimalGenerator) Encode(value uint64, stringLength int) string

Encode encodes a uint64 value to string in base26 format

func (*HexavigesimalGenerator) GetMaxValue

func (*HexavigesimalGenerator) GetMaxValue(stringLength int, baseLength int) int

Get the maximum number for encoding string of specified length by base of specified length

func (*HexavigesimalGenerator) Next

func (g *HexavigesimalGenerator) Next() interface{}

func (*HexavigesimalGenerator) Type

type HexavigesimalGeneratorConfig

type HexavigesimalGeneratorConfig struct {
	Minimum  int
	Maximum  int
	Length   int
	KeyRange *config.TableConfigGeneratorRange
}

type Int64Generator

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

func (*Int64Generator) Next

func (g *Int64Generator) Next() interface{}

func (*Int64Generator) Type

func (g *Int64Generator) Type() spansql.TypeBase

type NumericGenerator

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

func (*NumericGenerator) Next

func (g *NumericGenerator) Next() interface{}

func (*NumericGenerator) Type

func (g *NumericGenerator) Type() spansql.TypeBase

type RandomByteGenerator

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

func (*RandomByteGenerator) Next

func (g *RandomByteGenerator) Next() interface{}

func (*RandomByteGenerator) Type

type SingleKey

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

SingleKey is used to return a spanner key containing only 1 static value

func (*SingleKey) Next

func (g *SingleKey) Next() interface{}

func (*SingleKey) Type

func (g *SingleKey) Type() spansql.TypeBase

type StaticBooleanGenerator

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

func (*StaticBooleanGenerator) Next

func (g *StaticBooleanGenerator) Next() interface{}

func (*StaticBooleanGenerator) Type

type StaticBytesGenerator

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

func (*StaticBytesGenerator) Next

func (g *StaticBytesGenerator) Next() interface{}

func (*StaticBytesGenerator) Type

type StaticDateGenerator

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

func (*StaticDateGenerator) Next

func (g *StaticDateGenerator) Next() interface{}

func (*StaticDateGenerator) Type

type StaticFloat64Generator

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

func (*StaticFloat64Generator) Next

func (g *StaticFloat64Generator) Next() interface{}

func (*StaticFloat64Generator) Type

type StaticInt64Generator

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

func (*StaticInt64Generator) Next

func (g *StaticInt64Generator) Next() interface{}

func (*StaticInt64Generator) Type

type StaticNumericGenerator

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

func (*StaticNumericGenerator) Next

func (g *StaticNumericGenerator) Next() interface{}

func (*StaticNumericGenerator) Type

type StaticStringGenerator

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

func (*StaticStringGenerator) Next

func (g *StaticStringGenerator) Next() interface{}

func (*StaticStringGenerator) Type

type StaticTimestampGenerator

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

func (*StaticTimestampGenerator) Next

func (g *StaticTimestampGenerator) Next() interface{}

func (*StaticTimestampGenerator) Type

type StringGenerator

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

StringGenerator returns randomly generated strings of a fixed length

func (*StringGenerator) Next

func (s *StringGenerator) Next() interface{}

* Next returns the next randomly generated value * * The random string generation method was borrowed from icza * See: https://stackoverflow.com/a/31832326/145479

func (*StringGenerator) Type

func (s *StringGenerator) Type() spansql.TypeBase

type SubRangeGenerator

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

SubRangeGenerator randomly chooses a generator and returns it's Next() value

func NewSubRangeGenerator

func NewSubRangeGenerator(cfg Config) (*SubRangeGenerator, error)

func (*SubRangeGenerator) AddGenerator

func (g *SubRangeGenerator) AddGenerator(x Generator)

func (*SubRangeGenerator) Next

func (g *SubRangeGenerator) Next() interface{}

func (*SubRangeGenerator) Type

type ThreadDataGenerator

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

func (*ThreadDataGenerator) GetThreadGenerators

func (s *ThreadDataGenerator) GetThreadGenerators()

type ThreadDataGeneratorConfig

type ThreadDataGeneratorConfig struct {
	PrefixLength int
	StringLength int
	RowCount     int
	ThreadCount  int
}

type TimestampGenerator

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

func (*TimestampGenerator) Next

func (g *TimestampGenerator) Next() interface{}

func (*TimestampGenerator) Type

Jump to

Keyboard shortcuts

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