s3fs

package
v1.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	*FileInfo
}

func (*Dir) Close

func (d *Dir) Close() error

func (*Dir) IsDir

func (d *Dir) IsDir() bool

func (*Dir) Mode

func (d *Dir) Mode() fs.FileMode

func (*Dir) Read

func (d *Dir) Read(p []byte) (n int, err error)

func (*Dir) Stat

func (d *Dir) Stat() (fs.FileInfo, error)

type FS

type FS struct {
	// contains filtered or unexported fields
}

FS is only for accessing files in a single bucket. The directory entries are cached. It is specifically intended for use by a source that calls fs.WalkDir and does not fully implement all fs operations

func New

func New(logger *zap.Logger, s3Client S3ClientAPI, bucket string) (*FS, error)

New creates a FS for the single bucket

func (*FS) Open

func (f *FS) Open(name string) (fs.File, error)

Open implements fs.FS. For the S3 filesystem, it fetches the object contents from s3.

func (*FS) ReadDir

func (f *FS) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir implements fs.ReadDirFS. For the s3 filesystem, this returns the previously fetched objects in the bucket. This can only be called on the current directory as the s3 filesystem does not support any kind of recursive directory structure

func (*FS) Stat

func (f *FS) Stat(name string) (fs.FileInfo, error)

Stat implements fs.StatFS. For the s3 filesystem, this gets the objects in the s3 bucket and stores them for later use. Stat can only be called on the currect directory as the s3 filesystem only supports walking a single bucket configured at creation time.

type File

type File struct {
	// contains filtered or unexported fields
}

func (*File) Close

func (f *File) Close() error

func (*File) Read

func (f *File) Read(p []byte) (int, error)

func (*File) Stat

func (f *File) Stat() (fs.FileInfo, error)

type FileInfo

type FileInfo struct {
	// contains filtered or unexported fields
}

func (*FileInfo) Info

func (fi *FileInfo) Info() (fs.FileInfo, error)

func (*FileInfo) IsDir

func (fi *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (fi *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (fi *FileInfo) Mode() fs.FileMode

func (*FileInfo) Name

func (fi *FileInfo) Name() string

func (*FileInfo) Size

func (fi *FileInfo) Size() int64

func (*FileInfo) Sys

func (fi *FileInfo) Sys() any

func (*FileInfo) Type

func (fi *FileInfo) Type() fs.FileMode

type S3ClientAPI

type S3ClientAPI interface {
	ListObjectsV2(context.Context, *s3.ListObjectsV2Input, ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
	GetObject(context.Context, *s3.GetObjectInput, ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL