Documentation ¶
Overview ¶
Package s3fs implements fs.FS for AWS S3.
Package s3fs implements fs.FS for AWS S3.
Index ¶
- func DirectoryBucketAZ(bucket string) string
- func IsDirectoryBucket(bucket string) bool
- func New(cfg aws.Config, options ...Option) filewalk.FS
- func NewCheckpointOperation(fs *T) checkpoint.Operation
- func NewLevelScanner(client Client, delimiter byte, path string) filewalk.LevelScanner
- type Client
- type Factory
- type Option
- type T
- func (s3fs *T) Base(p string) string
- func (s3fs *T) Delete(ctx context.Context, path string) error
- func (s3fs *T) DeleteAll(ctx context.Context, path string) error
- func (s3fs *T) EnsurePrefix(_ context.Context, path string, _ fs.FileMode) error
- func (s3fs *T) Get(ctx context.Context, path string) ([]byte, error)
- func (s3fs *T) IsNotExist(err error) bool
- func (s3fs *T) IsPermissionError(err error) bool
- func (s3fs *T) Join(components ...string) string
- func (fs *T) LevelScanner(prefix string) filewalk.LevelScanner
- func (s3fs *T) Lstat(ctx context.Context, path string) (file.Info, error)
- func (s3fs *T) Open(name string) (fs.File, error)
- func (s3fs *T) OpenCtx(ctx context.Context, name string) (fs.File, error)
- func (s3fs *T) Put(ctx context.Context, path string, _ fs.FileMode, data []byte) error
- func (s3fs *T) Readlink(_ context.Context, _ string) (string, error)
- func (s3fs *T) Scheme() string
- func (s3fs *T) Stat(ctx context.Context, name string) (file.Info, error)
- func (s3fs *T) SysXAttr(existing any, merge file.XAttr) any
- func (s3fs *T) XAttr(_ context.Context, _ string, info file.Info) (file.XAttr, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirectoryBucketAZ ¶
func IsDirectoryBucket ¶
func NewCheckpointOperation ¶
func NewCheckpointOperation(fs *T) checkpoint.Operation
NewCheckpointOperation returns a checkpoint.Operation that uses the S3.
func NewLevelScanner ¶
func NewLevelScanner(client Client, delimiter byte, path string) filewalk.LevelScanner
Types ¶
type Client ¶
type Client interface { GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error) HeadObject(context.Context, *s3.HeadObjectInput, ...func(*s3.Options)) (*s3.HeadObjectOutput, error) GetBucketAcl(ctx context.Context, params *s3.GetBucketAclInput, optFns ...func(*s3.Options)) (*s3.GetBucketAclOutput, error) ListObjectsV2(context.Context, *s3.ListObjectsV2Input, ...func(*s3.Options)) (*s3.ListObjectsV2Output, error) PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error) DeleteObject(ctx context.Context, params *s3.DeleteObjectInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectOutput, error) DeleteObjects(ctx context.Context, params *s3.DeleteObjectsInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectsOutput, error) }
Client represents the set of AWS S3 client methods used by s3fs.
type Factory ¶
Factory wraps creating an S3FS with the configuration required to correctly initialize it.
type Option ¶
type Option func(o *options)
Option represents an option to New.
func WithDelimiter ¶
WithDelimiter sets the delimiter to use when listing objects, the default is /.
func WithS3Client ¶
WithS3Client specifies the s3.Client to use. If not specified, a new is created.
func WithS3Options ¶
WithS3Options wraps s3.Options for use when creating an s3.Client.
func WithScanSize ¶
WithScanSize sets the number of items to fetch in a single remote api invocation for operations such as DeleteAll which may require iterating over a range of objects.
type T ¶
type T struct {
// contains filtered or unexported fields
}
func (*T) EnsurePrefix ¶
func (*T) IsNotExist ¶
func (*T) IsPermissionError ¶
func (*T) Join ¶
Join concatenates the supplied components ensuring to insert delimiters only when necessary, that is components ending or starting with / (or the currently configured delimiter) will not
func (*T) LevelScanner ¶
func (fs *T) LevelScanner(prefix string) filewalk.LevelScanner