Documentation ¶
Overview ¶
Package s3fs provides a S3 implementation for Go1.16 filesystem interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithReadSeeker ¶
func WithReadSeeker(fsys *S3FS)
WithReadSeeker enables Seek functionality on files opened with this fs.
BUG(WilliamFrei): Seeking on S3 requires reopening the file at the specified position. This can cause problems if the file changed between opening and calling Seek. In that case, fs.ErrNotExist error is returned, which has to be handled by the caller.
Types ¶
type Client ¶
type Client interface { HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error) ListObjects(ctx context.Context, params *s3.ListObjectsInput, optFns ...func(*s3.Options)) (*s3.ListObjectsOutput, error) GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error) }
Client wraps the s3 client methods that this package is using. This interface may change in the future and should not be relied on by packages using it.
type S3FS ¶
type S3FS struct {
// contains filtered or unexported fields
}
S3FS is a S3 filesystem implementation.
S3 has a flat structure instead of a hierarchy. S3FS simulates directories by using prefixes and delims ("/"). Because directories are simulated, ModTime is always a default Time value (IsZero returns true).
Notes ¶
Bugs ¶
Seeking on S3 requires reopening the file at the specified position. This can cause problems if the file changed between opening and calling Seek. In that case, fs.ErrNotExist error is returned, which has to be handled by the caller.