Documentation
¶
Overview ¶
Package s3 enables in-order streaming of data to and from files stored in Amazon S3.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSeekPositionNotSupported occurs when a syncable type receives a // seek destination which it can not fulfil to. These syncable types // usually only support seeking to the beginning or to the end, as they // write to and read from multiple data files. ErrSeekPositionNotSupported = errors.New("Seek position is not supported.") )
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // MinSize is used to determine the number of megabytes to write to // a file before the file should be rotated, and a new file used. This // is only available on certain types which support rotation of files, // but do not support appendable writes. The file is overwritten on // each write using the buffered data. MinSize should be specified in // megabytes. MinSize int }
Options represents syncing configuration options.
type Storage ¶
Storage represents a Amazon S3 reader and writer.
func (*Storage) Close ¶
Close closes the underlying Syncable storage data stream, and prevents any further reads of writes to the Storage instance.
func (*Storage) Read ¶
Read reads up to len(p) bytes into p, reading from the Storage data stream, and automatically rotating files when the end of a file is reached. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. If the Storage has reached the final log file, then an EOF error will be returned.
func (*Storage) Seek ¶
Seek sets the offset for the next Read or Write to offset, interpreted according to whence: SeekStart means relative to the start of the file, SeekCurrent means relative to the current offset, and SeekE8nd means relative to the end. Seek returns the new offset relative to the start of the file and an error, if any. In some storage types, Seek only supports seeking to the beginning and end of the data stream.
func (*Storage) Sync ¶
Sync ensures that any buffered data in the stream is committed to stable storage. In some Syncable types, Seek does nothing, as the data is written and persisted immediately when a Write is made. On Syncable types which support BufferWrites, then Sync will ensure the data stored is flushed.
func (*Storage) Write ¶
Write writes len(p) bytes from p to the underlying Storage data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write will always append data to the end of the Storage data stream, ensuring data is append-only and never overwritten.