Documentation ¶
Overview ¶
Package s3readerat implements io.ReaderAt using S3 GetObject and Range.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Debug indicates whether to enable debug logging. Debug bool // Context is the context.Context to use. Context context.Context // Client is the s3.Client to use when running in single-region mode. You can instead pass s3.Options to run in // multi-region mode. Client *s3.Client // Options are the s3.Options to use when running in multi-region mode. In this mode, S3ReaderAt constructs the // s3.Client for you in the appropriate region(s). You can instead pass s3.Client to run in single-region mode. Options *s3.Options // Bucket is the AWS S3 bucket to use. Bucket string // Key is the key to use within the AWS S3 bucket. It should not start with a leading slash. Key string // Size is the size in bytes to use, if known in advance. This is an optimization that avoids calling "HeadObject". Size *int64 }
type S3ReaderAt ¶
type S3ReaderAt struct { Debug bool // contains filtered or unexported fields }
S3ReaderAt is io.ReaderAt implementation that makes HTTP Range Requests. New instances must be created with the New() function. It is safe for concurrent use.
func NewWithOptions ¶
func NewWithOptions(options Options) (*S3ReaderAt, error)
func NewWithSize ¶
NewWithSize creates a new S3ReaderAt that skips checking the S3 object's size.
func (*S3ReaderAt) ReadAt ¶
func (ra *S3ReaderAt) ReadAt(p []byte, off int64) (int, error)
ReadAt reads len(b) bytes from the remote file starting at byte offset off. It returns the number of bytes read and the error, if any. ReadAt always returns a non-nil error when n < len(b). At end of file, that error is io.EOF. It is safe for concurrent use.
func (*S3ReaderAt) Size ¶
func (ra *S3ReaderAt) Size() (int64, error)
func (*S3ReaderAt) WithContext ¶
func (ra *S3ReaderAt) WithContext(ctx context.Context) *S3ReaderAt
Click to show internal directories.
Click to hide internal directories.