randomstore

package
v0.0.0-...-d3ce8bf Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomStoreValueBatch

func RandomStoreValueBatch(
	ctx context.Context,
	ctr *app.Container,
	conf RandomStoreValueConfig,
	rowConf io.Reader,
	store *sync.Map,
) (map[string]string, error)

Types

type ConstantValueGenerator

type ConstantValueGenerator struct {
	Key   string
	Value string
}

func (*ConstantValueGenerator) Generate

func (p *ConstantValueGenerator) Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error

type RadomGenerator

type RadomGenerator interface {
	Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error
}

type RandomBoolValueGenerator

type RandomBoolValueGenerator struct {
	Key string
}

func (*RandomBoolValueGenerator) Generate

func (p *RandomBoolValueGenerator) Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error

type RandomDatetimeValueGenerator

type RandomDatetimeValueGenerator struct {
	Key    string
	Format string
}

func (*RandomDatetimeValueGenerator) Generate

func (p *RandomDatetimeValueGenerator) Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error

type RandomElementValueGenerator

type RandomElementValueGenerator struct {
	Key    string
	Values []interface{}
}

func (*RandomElementValueGenerator) Generate

func (p *RandomElementValueGenerator) Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error

type RandomFloatValueGenerator

type RandomFloatValueGenerator struct {
	Key       string
	From      float64
	To        float64
	Precision int
}

func (*RandomFloatValueGenerator) Generate

func (p *RandomFloatValueGenerator) Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error

type RandomGenerator

type RandomGenerator interface {
	Init(conf io.Reader) error
	GeneratorFactory(ctx context.Context, ctr *app.Container) (RadomGenerator, error)
}

func GetRandomGeneratorFactory

func GetRandomGeneratorFactory(t string) RandomGenerator

type RandomIntValueGenerator

type RandomIntValueGenerator struct {
	Key  string
	From int
	To   int
}

func (*RandomIntValueGenerator) Generate

func (p *RandomIntValueGenerator) Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error

type RandomStoreValueBoolDataConfig

type RandomStoreValueBoolDataConfig struct {
	Key  string `yaml:"key"`
	Type string `yaml:"type"`
}

func (*RandomStoreValueBoolDataConfig) GeneratorFactory

func (*RandomStoreValueBoolDataConfig) Init

type RandomStoreValueConfig

type RandomStoreValueConfig struct {
	Type string                       `yaml:"type"`
	Data []RandomStoreValueDataConfig `yaml:"data"`
}

type RandomStoreValueConstantDataConfig

type RandomStoreValueConstantDataConfig struct {
	Key   string `yaml:"key"`
	Type  string `yaml:"type"`
	Value string `yaml:"value"`
}

func (*RandomStoreValueConstantDataConfig) GeneratorFactory

func (*RandomStoreValueConstantDataConfig) Init

type RandomStoreValueDataConfig

type RandomStoreValueDataConfig struct {
	Key  string `yaml:"key"`
	Type string `yaml:"type"`
}

type RandomStoreValueDatetimeDataConfig

type RandomStoreValueDatetimeDataConfig struct {
	Key    string `yaml:"key"`
	Type   string `yaml:"type"`
	Format string `yaml:"format"`
}

func (*RandomStoreValueDatetimeDataConfig) GeneratorFactory

func (*RandomStoreValueDatetimeDataConfig) Init

type RandomStoreValueElementDataConfig

type RandomStoreValueElementDataConfig struct {
	Key   string `yaml:"key"`
	Type  string `yaml:"type"`
	Value []any  `yaml:"value"`
}

func (*RandomStoreValueElementDataConfig) GeneratorFactory

func (*RandomStoreValueElementDataConfig) Init

type RandomStoreValueFloatDataConfig

type RandomStoreValueFloatDataConfig struct {
	Key       string  `yaml:"key"`
	Type      string  `yaml:"type"`
	From      float64 `yaml:"from"`
	To        float64 `yaml:"to"`
	Precision int     `yaml:"precision"`
}

func (*RandomStoreValueFloatDataConfig) GeneratorFactory

func (*RandomStoreValueFloatDataConfig) Init

type RandomStoreValueIntDataConfig

type RandomStoreValueIntDataConfig struct {
	Key  string `yaml:"key"`
	Type string `yaml:"type"`
	From int    `yaml:"from"`
	To   int    `yaml:"to"`
}

func (*RandomStoreValueIntDataConfig) GeneratorFactory

func (*RandomStoreValueIntDataConfig) Init

type RandomStoreValueRawConfig

type RandomStoreValueRawConfig struct {
	Type string `yaml:"type"`
	Data []any  `yaml:"data"`
}

type RandomStoreValueStringDataConfig

type RandomStoreValueStringDataConfig struct {
	Key     string `yaml:"key"`
	Type    string `yaml:"type"`
	Length  int    `yaml:"length"`
	CharSet string `yaml:"charSet"` // "numeric,[!@#$%^&*],capital,lower"
}

func (*RandomStoreValueStringDataConfig) GeneratorFactory

func (*RandomStoreValueStringDataConfig) Init

type RandomStoreValueUUIDDataConfig

type RandomStoreValueUUIDDataConfig struct {
	Key  string `yaml:"key"`
	Type string `yaml:"type"`
}

func (*RandomStoreValueUUIDDataConfig) GeneratorFactory

func (*RandomStoreValueUUIDDataConfig) Init

type RandomStringValueGenerator

type RandomStringValueGenerator struct {
	Key     string
	Length  int
	CharSet string
}

func (*RandomStringValueGenerator) Generate

func (p *RandomStringValueGenerator) Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error

type RandomUUIDValueGenerator

type RandomUUIDValueGenerator struct {
	Key string
}

func (*RandomUUIDValueGenerator) Generate

func (p *RandomUUIDValueGenerator) Generate(ctx context.Context, ctr *app.Container, store *sync.Map) error

Jump to

Keyboard shortcuts

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