fs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalStackEndpoint = "http://localhost:4566"

Functions

func CanAccess added in v0.3.1

func CanAccess(list []string, destPath string) bool

func DirCombination added in v0.3.0

func DirCombination(keyPath string) []string

func MostParentPath

func MostParentPath(s string) string

func NewFileSystem

func NewFileSystem(sess *S3Session) *pathfs.PathNodeFs

func NextParentPath

func NextParentPath(s, prefix string) string

Types

type FileSystem

type FileSystem struct {
	pathfs.FileSystem
	// contains filtered or unexported fields
}

func (*FileSystem) Access

func (f *FileSystem) Access(name string, mode uint32, _ *fuse.Context) (code fuse.Status)

func (*FileSystem) Create

func (f *FileSystem) Create(name string, flags uint32, mode uint32, ctx *fuse.Context) (nodefs.File, fuse.Status)

func (*FileSystem) GetAttr

func (f *FileSystem) GetAttr(name string, ctx *fuse.Context) (*fuse.Attr, fuse.Status)

func (*FileSystem) Mkdir

func (f *FileSystem) Mkdir(name string, mode uint32, ctx *fuse.Context) fuse.Status

func (*FileSystem) Open

func (f *FileSystem) Open(name string, flags uint32, ctx *fuse.Context) (nodefs.File, fuse.Status)

func (*FileSystem) OpenDir

func (f *FileSystem) OpenDir(name string, _ *fuse.Context) ([]fuse.DirEntry, fuse.Status)

func (*FileSystem) Rename

func (f *FileSystem) Rename(oldName string, newName string, _ *fuse.Context) fuse.Status

func (*FileSystem) Rmdir added in v0.3.0

func (f *FileSystem) Rmdir(name string, ctx *fuse.Context) (code fuse.Status)

func (*FileSystem) String

func (f *FileSystem) String() string
func (f *FileSystem) Unlink(name string, _ *fuse.Context) (code fuse.Status)

func (*FileSystem) Utimens

func (f *FileSystem) Utimens(name string, Atime *time.Time, Mtime *time.Time, ctx *fuse.Context) (code fuse.Status)

type Move added in v0.4.0

type Move struct {
	SourceBucket string
	SourceKey    string
	DestBucket   string
	DestKey      string
}

func NewMove added in v0.4.0

func NewMove(source, dest Position) Move

type Position

type Position struct {
	IsMountRoot  bool
	IsBucketRoot bool
	Bucket       string
	Key          string
	OriginalPath string
}

func Parse

func Parse(name string) Position

type S3File

type S3File struct {
	nodefs.File
	// contains filtered or unexported fields
}

func (*S3File) Allocate

func (f *S3File) Allocate(off uint64, size uint64, mode uint32) (code fuse.Status)

func (*S3File) Flush

func (f *S3File) Flush() fuse.Status

func (*S3File) Fsync

func (f *S3File) Fsync(flags int) (code fuse.Status)

func (*S3File) Read

func (f *S3File) Read(dest []byte, off int64) (fuse.ReadResult, fuse.Status)

func (*S3File) Release

func (f *S3File) Release()

func (*S3File) String

func (f *S3File) String() string

func (*S3File) Truncate

func (f *S3File) Truncate(size uint64) fuse.Status

func (*S3File) Utimens

func (f *S3File) Utimens(atime *time.Time, mtime *time.Time) fuse.Status

func (*S3File) Write

func (f *S3File) Write(data []byte, off int64) (written uint32, code fuse.Status)

type S3Object

type S3Object struct {
	// S3 key
	Key string

	// S3 LastModified
	LastModified *time.Time

	// Size in bytes of the object
	Size int64 `type:"integer"`
}

type S3Session

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

func NewS3Session

func NewS3Session(region string) *S3Session

func (*S3Session) CreateBucket

func (s *S3Session) CreateBucket(bucket string) error

func (*S3Session) Delete

func (s *S3Session) Delete(bucket, key string) error

func (*S3Session) DeleteBucket added in v0.3.0

func (s *S3Session) DeleteBucket(bucket string) error

func (*S3Session) Exists

func (s *S3Session) Exists(bucket, key string) bool

func (*S3Session) ExistsBucket

func (s *S3Session) ExistsBucket(bucket string) bool

func (*S3Session) Get

func (s *S3Session) Get(bucket, key string) ([]byte, error)

func (*S3Session) List

func (s *S3Session) List(bucket, prefix string) ([]S3Object, error)

func (*S3Session) ListBuckets

func (s *S3Session) ListBuckets() ([]string, error)

func (*S3Session) Put

func (s *S3Session) Put(bucket, key string, r io.ReadSeeker) error

func (*S3Session) PutBytes

func (s *S3Session) PutBytes(bucket, key string, b []byte) error

Jump to

Keyboard shortcuts

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