generate

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package generate is for generating random data from given structures

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignMaxLen

func AssignMaxLen(cfg *Config)

AssignMaxLen sets a maximum length for generated values.

func AssignSeed

func AssignSeed(cfg *Config)

AssignSeed sets a specific random seed to be used.

func AssignUseRandomType

func AssignUseRandomType(cfg *Config)

AssignUseRandomType causes generator to generate random types of values.

Types

type Config

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

Config stores settings for the generate package.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration for a Generator.

type Generator

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

Generator is a dsio.EntryReader that creates a new entry on each call to ReadEntry

func NewGenerator

func NewGenerator(st *dataset.Structure, options ...func(*Config)) (*Generator, error)

NewGenerator creates a generator with the given configuration options

func (Generator) Close

func (g Generator) Close() error

Close finalizes the generator

func (*Generator) ReadEntry

func (g *Generator) ReadEntry() (dsio.Entry, error)

ReadEntry implements the dsio.EntryReader interface

func (Generator) Structure

func (g Generator) Structure() *dataset.Structure

Structure implements the dsio.EntryReader interface

Jump to

Keyboard shortcuts

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