Documentation ¶
Index ¶
- Variables
- type Stream
- type StreamBuffer
- func (mb *StreamBuffer) Cleanup() error
- func (mb *StreamBuffer) Close() (err error)
- func (mb *StreamBuffer) File() *os.File
- func (mb *StreamBuffer) Lock()
- func (mb *StreamBuffer) NewReader() (io.ReadCloser, error)
- func (mb *StreamBuffer) Terminate() (err error)
- func (mb *StreamBuffer) Unlock()
- func (mb *StreamBuffer) Write(b []byte) (n int, err error)
- type StreamEndError
- type StreamReader
Constants ¶
This section is empty.
Variables ¶
var TmpDir = ""
TmpDir is the location for temporary files
Functions ¶
This section is empty.
Types ¶
type Stream ¶
type Stream interface { Mimetype() string NewReader() (io.ReadCloser, error) }
Stream is an object which produces readers from which to obtain data
func FromByteArray ¶
FromByteArray return a new stream from a byte object
type StreamBuffer ¶
StreamBuffer is a buffer with a file as its underlying buffer
func NewStreamBuffer ¶
func NewStreamBuffer(prefix string) (s *StreamBuffer, err error)
NewStreamBuffer returns a new stream buffer
func (*StreamBuffer) Cleanup ¶
func (mb *StreamBuffer) Cleanup() error
Cleanup removes the temporary file
func (*StreamBuffer) Close ¶
func (mb *StreamBuffer) Close() (err error)
Close closes the stream. No new readers allowed
func (*StreamBuffer) File ¶
func (mb *StreamBuffer) File() *os.File
File returns the underlying data file
func (*StreamBuffer) Lock ¶
func (mb *StreamBuffer) Lock()
Lock locks the data stream for manipulation
func (*StreamBuffer) NewReader ¶
func (mb *StreamBuffer) NewReader() (io.ReadCloser, error)
NewReader returns a new reader to the buffer
func (*StreamBuffer) Terminate ¶
func (mb *StreamBuffer) Terminate() (err error)
Terminate ends the stream and allows no more readers
type StreamEndError ¶
type StreamEndError struct{}
StreamEndError is returned when the stream has ended
func (*StreamEndError) Error ¶
func (*StreamEndError) Error() string
type StreamReader ¶
type StreamReader struct {
// contains filtered or unexported fields
}
StreamReader is a thread safe reader which reads from a stream buffer