Documentation ¶
Index ¶
- func CreateTar(w io.Writer, r *io.LimitedReader)
- func Handler(w http.ResponseWriter, r *http.Request)
- func MakeDir(name string)
- func TimeTrack(start time.Time, name string)
- type BufferTarInterpreter
- type FileReaderMaker
- type FileTarBall
- func (fileTarBall *FileTarBall) AddSize(i int64)
- func (fileTarBall *FileTarBall) AwaitUploads()
- func (fileTarBall *FileTarBall) CloseTar() error
- func (fileTarBall *FileTarBall) FileExtension() string
- func (fileTarBall *FileTarBall) Finish(sentinelDto *walg.S3TarBallSentinelDto) error
- func (fileTarBall *FileTarBall) SetUp(crypter walg.Crypter, names ...string)
- func (fileTarBall *FileTarBall) Size() int64
- func (fileTarBall *FileTarBall) TarWriter() *tar.Writer
- func (fileTarBall *FileTarBall) Trim() string
- type FileTarBallMaker
- type HTTPReaderMaker
- type NOPTarBall
- func (n *NOPTarBall) AddSize(i int64)
- func (b *NOPTarBall) AwaitUploads()
- func (n *NOPTarBall) CloseTar() error
- func (n *NOPTarBall) FileExtension() string
- func (n *NOPTarBall) Finish(sentinelDto *walg.S3TarBallSentinelDto) error
- func (n *NOPTarBall) SetUp(crypter walg.Crypter, params ...string)
- func (n *NOPTarBall) Size() int64
- func (n *NOPTarBall) TarWriter() *tar.Writer
- func (n *NOPTarBall) Trim() string
- type NOPTarBallMaker
- type NOPTarInterpreter
- type StrideByteReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTar ¶
func CreateTar(w io.Writer, r *io.LimitedReader)
CreateTar creates a new tarball from the passed in reader and writes to a destination writer.
func Handler ¶
func Handler(w http.ResponseWriter, r *http.Request)
Handler allows for generation of random bytes by configuring the URL 'https://localhost:8080/stride-N.bytes-N.tar.lzo' where byte size and stride length are customizable.
Compressed tar files are automatically generated. Grab using curl ie. 'curl -sk ...'
Types ¶
type BufferTarInterpreter ¶
type BufferTarInterpreter struct {
Out []byte
}
BufferTarInterpreter extracts data to a byte slice. Used for testing purposes.
type FileReaderMaker ¶
FileReaderMaker decompresses lzop tarballs from the passed in file.
func (*FileReaderMaker) Format ¶
func (f *FileReaderMaker) Format() string
func (*FileReaderMaker) Path ¶
func (f *FileReaderMaker) Path() string
func (*FileReaderMaker) Reader ¶
func (f *FileReaderMaker) Reader() (io.ReadCloser, error)
Reader creates a new reader from the passed in file.
type FileTarBall ¶
type FileTarBall struct {
// contains filtered or unexported fields
}
FileTarBall represents a tarball that is written to disk.
func (*FileTarBall) AddSize ¶ added in v0.1.8
func (fileTarBall *FileTarBall) AddSize(i int64)
func (*FileTarBall) AwaitUploads ¶ added in v0.1.8
func (fileTarBall *FileTarBall) AwaitUploads()
func (*FileTarBall) CloseTar ¶
func (fileTarBall *FileTarBall) CloseTar() error
CloseTar closes the tar writer and file, flushing any unwritten data to the file before closing.
func (*FileTarBall) FileExtension ¶ added in v0.1.11
func (fileTarBall *FileTarBall) FileExtension() string
func (*FileTarBall) Finish ¶
func (fileTarBall *FileTarBall) Finish(sentinelDto *walg.S3TarBallSentinelDto) error
Finish alerts that compression is complete.
func (*FileTarBall) SetUp ¶
func (fileTarBall *FileTarBall) SetUp(crypter walg.Crypter, names ...string)
SetUp creates a new LZ4 writer, tar writer and file for writing bundled compressed bytes to.
func (*FileTarBall) Size ¶
func (fileTarBall *FileTarBall) Size() int64
func (*FileTarBall) TarWriter ¶ added in v0.1.11
func (fileTarBall *FileTarBall) TarWriter() *tar.Writer
func (*FileTarBall) Trim ¶
func (fileTarBall *FileTarBall) Trim() string
type FileTarBallMaker ¶
FileTarBallMaker creates a new FileTarBall with the directory that files should be extracted to.
func (*FileTarBallMaker) Make ¶
func (f *FileTarBallMaker) Make(inheritState bool) walg.TarBall
Make creates a new FileTarBall.
type HTTPReaderMaker ¶
HTTPReaderMaker decompresses lzop tarballs from the passed in url.
func (*HTTPReaderMaker) Format ¶
func (h *HTTPReaderMaker) Format() string
func (*HTTPReaderMaker) Path ¶
func (h *HTTPReaderMaker) Path() string
func (*HTTPReaderMaker) Reader ¶
func (h *HTTPReaderMaker) Reader() (io.ReadCloser, error)
Reader creates a new request to grab the data generated by the random bytes generator.
type NOPTarBall ¶
type NOPTarBall struct {
// contains filtered or unexported fields
}
NOPTarBall mocks a tarball. Used for testing purposes.
func (*NOPTarBall) AddSize ¶ added in v0.1.8
func (n *NOPTarBall) AddSize(i int64)
func (*NOPTarBall) AwaitUploads ¶ added in v0.1.8
func (b *NOPTarBall) AwaitUploads()
func (*NOPTarBall) CloseTar ¶
func (n *NOPTarBall) CloseTar() error
func (*NOPTarBall) FileExtension ¶ added in v0.1.11
func (n *NOPTarBall) FileExtension() string
func (*NOPTarBall) Finish ¶
func (n *NOPTarBall) Finish(sentinelDto *walg.S3TarBallSentinelDto) error
func (*NOPTarBall) SetUp ¶
func (n *NOPTarBall) SetUp(crypter walg.Crypter, params ...string)
func (*NOPTarBall) Size ¶
func (n *NOPTarBall) Size() int64
func (*NOPTarBall) TarWriter ¶ added in v0.1.11
func (n *NOPTarBall) TarWriter() *tar.Writer
func (*NOPTarBall) Trim ¶
func (n *NOPTarBall) Trim() string
type NOPTarBallMaker ¶
type NOPTarBallMaker struct { Trim string // contains filtered or unexported fields }
NOPTarBallMaker creates a new NOPTarBall. Used for testing purposes.
func (*NOPTarBallMaker) Make ¶
func (n *NOPTarBallMaker) Make(inheritState bool) walg.TarBall
Make creates a new NOPTarBall.
type StrideByteReader ¶
type StrideByteReader struct {
// contains filtered or unexported fields
}
StrideByteReader allows for customizable "strides" of random bytes. Creates an infinite stream.
func NewStrideByteReader ¶
func NewStrideByteReader(s int) *StrideByteReader
NewStrideByteReader creates a new random byte stride generator with a seed of 0.