Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeObjectPrefixes ¶ added in v0.2.0
MergeObjectPrefixes merges prefixes from several slices of objects.
Types ¶
type CsvOpts ¶
type CsvOpts struct {
// contains filtered or unexported fields
}
CsvOpts provides options for CSV generation.
type Object ¶
type Object struct {
// Reader will return a reader that will return the number of requested bytes
// and EOF on all subsequent calls.
Reader io.Reader
// A random generated name.
Name string
// Corresponding mime type
ContentType string
// Size of the object to expect.
Size int64
Prefix string
VersionID string
}
type Option ¶
Option provides options for data generation. Use WithXXXX().Apply() to select data types and set options.
func WithRandomSize ¶
WithRandomSize will randomize the size from 1 byte to the total size set.
type OptionApplier ¶
type OptionApplier interface {
Apply() Option
}
OptionApplier allows to abstract generator options.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options provides options. Use WithXXX functions to set them.
type RandomOpts ¶
type RandomOpts struct {
// contains filtered or unexported fields
}
RandomOpts are the options for the random data source.
func WithRandomData ¶
func WithRandomData() RandomOpts
func (RandomOpts) RngSeed ¶
func (o RandomOpts) RngSeed(s int64) RandomOpts
RngSeed will which to a fixed RNG seed to make usage predictable.
func (RandomOpts) Size ¶
func (o RandomOpts) Size(s int) RandomOpts
Size will set a block size. Data of this size will be repeated until output size has been reached.
type Source ¶
type Source interface {
// Requesting a new reader will scramble data, so the new reader will not return the same data.
// Requesting a reader is designed to be as lightweight as possible.
// Only a single reader can be used concurrently.
Object() *Object
// String returns a human readable description of the source.
String() string
// Prefix returns the prefix if any.
Prefix() string
}
Click to show internal directories.
Click to hide internal directories.