Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExpRandSize ¶ added in v0.3.28
GetExpRandSize will return an exponential random size from 1 to and including max. Minimum size: 127 bytes, max scale is 256 times smaller than max size. Average size will be max_size * 0.179151.
func MergeObjectPrefixes ¶ added in v0.2.0
MergeObjectPrefixes merges prefixes from several slices of objects.
Types ¶
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.ReadSeeker // A random generated name. Name string // Corresponding mime type ContentType string Prefix string VersionID string // Size of the object to expect. Size int64 }
type Option ¶
Option provides options for data generation. Use WithXXXX().Apply() to select data types and set options.
func WithCustomPrefix ¶ added in v0.3.46
WithCustomPrefix adds custom prefix under bucket where all warp content is created.
func WithMinMaxSize ¶ added in v0.6.6
WithMinMaxSize sets the min and max size of the generated data.
func WithRandomSize ¶
WithRandomSize will randomize the size from 1 byte to the total size set.
func WithSizeHistograms ¶ added in v1.0.4
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 }