Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteTemplate ¶ added in v1.0.0
ExecuteTemplate takes a tmpl string and a n int and generates n rows of based on the specified tmpl. Will loop forever if streamMode is true
func GetCompletionFunc ¶ added in v1.1.0
GetCompletionFunc returns a string representing a completion function for the given shell. It returns an error for unsupported shell.
Types ¶
type ColumnFormatter ¶ added in v1.2.0
type ColumnFormatter struct {
Separator string
}
ColumnFormatter is a Formatter for character separated formats
func NewColumnFormatter ¶ added in v1.2.0
func NewColumnFormatter(sep string) (f *ColumnFormatter)
NewColumnFormatter returns a ColumnFormatter using the sep string as a separator
type Columns ¶ added in v0.2.0
type Columns []Column
Columns is an array of Column
func NewColumns ¶ added in v0.2.0
NewColumns returns an array of Columns using keys as a specification. It returns an error with a line for each unknown key
func (Columns) GenerateHeader ¶ added in v1.4.0
GenerateRow generates an header row using column names in the specified format
type Formatter ¶ added in v0.2.0
Formatter is the interface wraps the Format method we use to format each row
type Generator ¶ added in v0.2.0
type Generator struct { Func func() string CustomFunc func(string) (func() string, error) Desc string Name string Hidden bool }
A Generator is a func that generates random data along with its description
type Generators ¶ added in v0.2.0
type Generators []Generator
Generators is an array of Generator
func NewGenerators ¶ added in v1.0.0
func NewGenerators() (gens Generators)
NewGenerators returns the available generators
func (Generators) FindByName ¶ added in v1.0.0
func (gens Generators) FindByName(name string) (gen *Generator)
FindByName returns, if present, the generator with the name string
func (Generators) Visible ¶ added in v1.5.0
func (gens Generators) Visible() (newGens Generators)
Visible returns only the generators that should appear in the help list
func (Generators) WithConstraints ¶ added in v1.0.0
func (gens Generators) WithConstraints() (newGens Generators)
WithConstraints returns only the generators that accept constraints
type NdjsonFormatter ¶ added in v1.4.0
type NdjsonFormatter struct { }
NdJsonFormatter is a Formatter for http://ndjson.org/
func NewNdjsonFormatter ¶ added in v1.4.0
func NewNdjsonFormatter() (f *NdjsonFormatter)
NewNdjsonFormatter returns a NdjsonFormatter
type SQLFormatter ¶ added in v0.2.0
type SQLFormatter struct {
Table string
}
SQLFormatter is a Formatter for the SQL insert statement
func NewSQLFormatter ¶ added in v0.2.0
func NewSQLFormatter(table string) (f *SQLFormatter)
NewSQLFormatter returns a SQLFormatter using the table string for table name generation