s3fs

package module
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingClient     = errors.New("missing s3 client")
	ErrMissingBucketName = errors.New("missing bucket name")
)

Functions

This section is empty.

Types

type File

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

func (*File) Close

func (f *File) Close() error

func (*File) Key

func (f *File) Key() string

func (*File) Read

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

func (*File) Stat

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

func (*File) Write

func (f *File) Write(p []byte) (n int, err error)

type Filesystem

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

func New

func New(ctx context.Context, opts ...Option) (*Filesystem, error)

New creates a new S3 filesystem with the given options.

func (*Filesystem) Create

func (fs *Filesystem) Create(name string) (ros.File, error)

func (*Filesystem) Mkdir

func (fs *Filesystem) Mkdir(name string, perm ros.FileMode) error

func (*Filesystem) MkdirAll

func (fs *Filesystem) MkdirAll(path string, perm ros.FileMode) error

func (*Filesystem) Open

func (fs *Filesystem) Open(name string) (ros.File, error)

func (*Filesystem) OpenFile added in v1.3.0

func (*Filesystem) OpenFile(string, int, ros.FileMode) (ros.File, error)

func (*Filesystem) ReadDir

func (fs *Filesystem) ReadDir(name string) ([]ros.DirEntry, error)

func (*Filesystem) ReadFile

func (fs *Filesystem) ReadFile(name string) ([]byte, error)

func (*Filesystem) Remove

func (fs *Filesystem) Remove(name string) error

func (*Filesystem) RemoveAll

func (fs *Filesystem) RemoveAll(path string) error

func (*Filesystem) Rename

func (fs *Filesystem) Rename(oldpath, newpath string) error

func (*Filesystem) Stat

func (fs *Filesystem) Stat(name string) (ros.FileInfo, error)
func (fs *Filesystem) Symlink(oldname, newname string) error

func (*Filesystem) WalkDir added in v1.2.0

func (fs *Filesystem) WalkDir(root string, fn ros.WalkDirFunc) error

func (*Filesystem) WriteFile

func (fs *Filesystem) WriteFile(name string, data []byte, perm ros.FileMode) error

type Option

type Option func(*Filesystem)

Option is a configuration function for an S3 Filesystem.

func WithBase

func WithBase(dir string) Option

WithBase sets the base directory for the filesystem.

func WithBucket

func WithBucket(bucket string) Option

WithBucket sets the S3 bucket name for the filesystem.

func WithClient

func WithClient(client *s3.Client) Option

WithClient sets the S3 client for the filesystem.

Jump to

Keyboard shortcuts

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