Documentation ¶
Index ¶
- type ArrayGenerator
- type BooleanGenerator
- type CombinedGenerator
- type CombinedGeneratorConfig
- type CommitTimestampGenerator
- type CompositeKey
- type Config
- type DateGenerator
- type DateGeneratorConfig
- type Float64Generator
- type Generator
- func NewArrayGenerator(cfg Config) (Generator, error)
- func NewBooleanGenerator(cfg Config) (Generator, error)
- func NewCommitTimestampGenerator(cfg Config) (Generator, error)
- func NewDateGenerator(cfg Config) (Generator, error)
- func NewFloat64Generator(cfg Config) (Generator, error)
- func NewInt64Generator(cfg Config) (Generator, error)
- func NewJsonGenerator(cfg Config) (Generator, error)
- func NewNumericGenerator(cfg Config) (Generator, error)
- func NewRandomByteGenerator(cfg Config) (Generator, error)
- func NewStaticBooleanGenerator(cfg Config, vals []bool) (Generator, error)
- func NewStaticBytesGenerator(cfg Config, vals [][]byte) (Generator, error)
- func NewStaticDateGenerator(cfg Config, vals []civil.Date) (Generator, error)
- func NewStaticFloat64Generator(cfg Config, vals []float64) (Generator, error)
- func NewStaticInt64Generator(cfg Config, vals []int64) (Generator, error)
- func NewStaticNumericGenerator(cfg Config, vals []*big.Rat) (Generator, error)
- func NewStaticStringGenerator(cfg Config, vals []string) (Generator, error)
- func NewStaticTimestampGenerator(cfg Config, vals []time.Time) (Generator, error)
- func NewStringGenerator(cfg Config) (Generator, error)
- func NewTimestampGenerator(cfg Config) (Generator, error)
- type GeneratorMap
- type HexavigesimalGenerator
- func (g *HexavigesimalGenerator) Decode(s string) uint64
- func (g *HexavigesimalGenerator) Encode(value uint64, stringLength int) string
- func (*HexavigesimalGenerator) GetMaxValue(stringLength int, baseLength int) int
- func (g *HexavigesimalGenerator) Next() interface{}
- func (g *HexavigesimalGenerator) Type() spansql.TypeBase
- type HexavigesimalGeneratorConfig
- type Int64Generator
- type JsonGenerator
- type NumericGenerator
- type RandomByteGenerator
- type SingleKey
- type StaticBooleanGenerator
- type StaticBytesGenerator
- type StaticDateGenerator
- type StaticFloat64Generator
- type StaticInt64Generator
- type StaticNumericGenerator
- type StaticStringGenerator
- type StaticTimestampGenerator
- type StringGenerator
- type SubRangeGenerator
- type ThreadDataGenerator
- type ThreadDataGeneratorConfig
- type TimestampGenerator
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 ¶
func (s *CombinedGenerator) Type() spansql.TypeBase
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 CommitTimestampGenerator ¶
type CommitTimestampGenerator struct{}
func (*CommitTimestampGenerator) Next ¶
func (g *CommitTimestampGenerator) Next() interface{}
func (*CommitTimestampGenerator) Type ¶
func (g *CommitTimestampGenerator) Type() spansql.TypeBase
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 }
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 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 ¶
Generator is the interface that all data generators must satisfy
func NewArrayGenerator ¶
func NewBooleanGenerator ¶
func NewDateGenerator ¶
func NewFloat64Generator ¶
func NewInt64Generator ¶
func NewJsonGenerator ¶
func NewNumericGenerator ¶
func NewRandomByteGenerator ¶
func NewStaticBytesGenerator ¶
func NewStaticDateGenerator ¶
func NewStaticInt64Generator ¶
func NewStringGenerator ¶
func NewTimestampGenerator ¶
type GeneratorMap ¶
type HexavigesimalGenerator ¶
type HexavigesimalGenerator struct {
// contains filtered or unexported fields
}
func NewHexavigesimalGenerator ¶
func NewHexavigesimalGenerator(cfg HexavigesimalGeneratorConfig) (*HexavigesimalGenerator, error)
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 ¶
func (g *HexavigesimalGenerator) Type() spansql.TypeBase
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 JsonGenerator ¶
type JsonGenerator struct {
// contains filtered or unexported fields
}
func (*JsonGenerator) Next ¶
func (j *JsonGenerator) Next() interface{}
func (*JsonGenerator) Type ¶
func (j *JsonGenerator) 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 ¶
func (g *RandomByteGenerator) Type() spansql.TypeBase
type SingleKey ¶
type SingleKey struct {
// contains filtered or unexported fields
}
SingleKey is used to return a spanner key containing only 1 static value
type StaticBooleanGenerator ¶
type StaticBooleanGenerator struct {
// contains filtered or unexported fields
}
func (*StaticBooleanGenerator) Next ¶
func (g *StaticBooleanGenerator) Next() interface{}
func (*StaticBooleanGenerator) Type ¶
func (g *StaticBooleanGenerator) Type() spansql.TypeBase
type StaticBytesGenerator ¶
type StaticBytesGenerator struct {
// contains filtered or unexported fields
}
func (*StaticBytesGenerator) Next ¶
func (g *StaticBytesGenerator) Next() interface{}
func (*StaticBytesGenerator) Type ¶
func (g *StaticBytesGenerator) Type() spansql.TypeBase
type StaticDateGenerator ¶
type StaticDateGenerator struct {
// contains filtered or unexported fields
}
func (*StaticDateGenerator) Next ¶
func (g *StaticDateGenerator) Next() interface{}
func (*StaticDateGenerator) Type ¶
func (g *StaticDateGenerator) Type() spansql.TypeBase
type StaticFloat64Generator ¶
type StaticFloat64Generator struct {
// contains filtered or unexported fields
}
func (*StaticFloat64Generator) Next ¶
func (g *StaticFloat64Generator) Next() interface{}
func (*StaticFloat64Generator) Type ¶
func (g *StaticFloat64Generator) Type() spansql.TypeBase
type StaticInt64Generator ¶
type StaticInt64Generator struct {
// contains filtered or unexported fields
}
func (*StaticInt64Generator) Next ¶
func (g *StaticInt64Generator) Next() interface{}
func (*StaticInt64Generator) Type ¶
func (g *StaticInt64Generator) Type() spansql.TypeBase
type StaticNumericGenerator ¶
type StaticNumericGenerator struct {
// contains filtered or unexported fields
}
func (*StaticNumericGenerator) Next ¶
func (g *StaticNumericGenerator) Next() interface{}
func (*StaticNumericGenerator) Type ¶
func (g *StaticNumericGenerator) Type() spansql.TypeBase
type StaticStringGenerator ¶
type StaticStringGenerator struct {
// contains filtered or unexported fields
}
func (*StaticStringGenerator) Next ¶
func (g *StaticStringGenerator) Next() interface{}
func (*StaticStringGenerator) Type ¶
func (g *StaticStringGenerator) Type() spansql.TypeBase
type StaticTimestampGenerator ¶
type StaticTimestampGenerator struct {
// contains filtered or unexported fields
}
func (*StaticTimestampGenerator) Next ¶
func (g *StaticTimestampGenerator) Next() interface{}
func (*StaticTimestampGenerator) Type ¶
func (g *StaticTimestampGenerator) Type() spansql.TypeBase
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 ¶
func (g *SubRangeGenerator) Type() spansql.TypeBase
type ThreadDataGenerator ¶
type ThreadDataGenerator struct {
// contains filtered or unexported fields
}
func NewThreadDataGenerator ¶
func NewThreadDataGenerator(cfg ThreadDataGeneratorConfig) (*ThreadDataGenerator, error)
func (*ThreadDataGenerator) GetThreadGenerators ¶
func (s *ThreadDataGenerator) GetThreadGenerators()
type TimestampGenerator ¶
type TimestampGenerator struct {
// contains filtered or unexported fields
}
func (*TimestampGenerator) Next ¶
func (g *TimestampGenerator) Next() interface{}
func (*TimestampGenerator) Type ¶
func (g *TimestampGenerator) Type() spansql.TypeBase