filesystem

package
v2.0.0-...-398017a Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(filename string) bool

func FolderExists

func FolderExists(filename string) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

Types

type DummyDirEntry

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

func NewDummyDirEntry

func NewDummyDirEntry(name string) *DummyDirEntry

func (DummyDirEntry) Info

func (sdi DummyDirEntry) Info() (os.FileInfo, error)

func (DummyDirEntry) IsDir

func (sdi DummyDirEntry) IsDir() bool

func (DummyDirEntry) Name

func (sdi DummyDirEntry) Name() string

func (DummyDirEntry) Type

func (sdi DummyDirEntry) Type() os.FileMode

type FileGetOptions

type FileGetOptions struct {
	VersionID string
}

FileGetOptions GetObjectOptions represents options specified by user for GetObject call

type FilePutOptions

type FilePutOptions struct {
	Progress    io.Reader
	ContentType string
}

FilePutOptions PutObjectOptions represents options specified by user for PutObject call

type FileStatOptions

type FileStatOptions struct {
}

type FileSystem

type FileSystem interface {
	FolderExists(folder string) (bool, error)
	FolderCreate(folder string, opts FolderCreateOptions) error
	FileExists(folder, name string) (bool, error)
	FileGet(folder, name string, opts FileGetOptions) ([]byte, error)
	FilePut(folder, name string, data []byte, opts FilePutOptions) error
	FileWrite(folder, name string, r io.Reader, size int64, opts FilePutOptions) error
	FileRead(folder, name string, w io.Writer, size int64, opts FileGetOptions) error
	FileOpenRead(folder, name string, opts FileGetOptions) (io.ReadCloser, string, error)
	FileStat(folder, name string, opts FileStatOptions) (fs.FileInfo, error)
	FileList(folder, name string) ([]fs.DirEntry, error)
	String() string
	Protocol() string
}

type FolderCreateOptions

type FolderCreateOptions struct {
	ObjectLocking bool
}

type LocalDirEntry

type LocalDirEntry struct {
	os.FileInfo
	// contains filtered or unexported fields
}

func (LocalDirEntry) Info

func (lde LocalDirEntry) Info() (os.FileInfo, error)

func (LocalDirEntry) IsDir

func (lde LocalDirEntry) IsDir() bool

func (LocalDirEntry) Name

func (lde LocalDirEntry) Name() string

func (LocalDirEntry) Type

func (lde LocalDirEntry) Type() os.FileMode

type LocalFs

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

func NewLocalFs

func NewLocalFs(basepath string, logger *logging.Logger) (*LocalFs, error)

func (*LocalFs) FileExists

func (lfs *LocalFs) FileExists(folder, name string) (bool, error)

func (*LocalFs) FileGet

func (lfs *LocalFs) FileGet(folder, name string, opts FileGetOptions) ([]byte, error)

func (*LocalFs) FileList

func (lfs *LocalFs) FileList(folder, name string) ([]fs.DirEntry, error)

func (*LocalFs) FileOpenRead

func (lfs *LocalFs) FileOpenRead(folder, name string, opts FileGetOptions) (io.ReadCloser, string, error)

func (*LocalFs) FilePut

func (lfs *LocalFs) FilePut(folder, name string, data []byte, opts FilePutOptions) error

func (*LocalFs) FileRead

func (lfs *LocalFs) FileRead(folder, name string, w io.Writer, size int64, opts FileGetOptions) error

func (*LocalFs) FileStat

func (lfs *LocalFs) FileStat(folder, name string, opts FileStatOptions) (os.FileInfo, error)

func (*LocalFs) FileWrite

func (lfs *LocalFs) FileWrite(folder, name string, r io.Reader, size int64, opts FilePutOptions) error

func (*LocalFs) FolderCreate

func (lfs *LocalFs) FolderCreate(folder string, opts FolderCreateOptions) error

func (*LocalFs) FolderExists

func (lfs *LocalFs) FolderExists(folder string) (bool, error)

func (*LocalFs) Protocol

func (lfs *LocalFs) Protocol() string

func (*LocalFs) String

func (lfs *LocalFs) String() string

type NotFoundError

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

func (*NotFoundError) Error

func (nf *NotFoundError) Error() string

type S3DirEntry

type S3DirEntry struct {
	S3FileInfo
}

func (S3DirEntry) Info

func (sdi S3DirEntry) Info() (os.FileInfo, error)

func (S3DirEntry) IsDir

func (sdi S3DirEntry) IsDir() bool

func (S3DirEntry) Name

func (sdi S3DirEntry) Name() string

func (S3DirEntry) Type

func (sdi S3DirEntry) Type() os.FileMode

type S3FileInfo

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

S3FileInfo A FileInfo describes a file and is returned by Stat and Lstat.

func NewS3FileInfo

func NewS3FileInfo(bucket, name string, info minio.ObjectInfo) *S3FileInfo

func (*S3FileInfo) IsDir

func (sfi *S3FileInfo) IsDir() bool

func (*S3FileInfo) ModTime

func (sfi *S3FileInfo) ModTime() time.Time

func (*S3FileInfo) Mode

func (sfi *S3FileInfo) Mode() os.FileMode

func (*S3FileInfo) Name

func (sfi *S3FileInfo) Name() string

func (*S3FileInfo) Size

func (sfi *S3FileInfo) Size() int64

func (*S3FileInfo) Sys

func (sfi *S3FileInfo) Sys() interface{}

type S3Fs

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

func NewS3Fs

func NewS3Fs(Endpoint string,
	AccessKeyId string,
	SecretAccessKey string,
	Expiration time.Duration,
	UseSSL bool) (*S3Fs, error)

func (*S3Fs) FileExists

func (fs *S3Fs) FileExists(folder, name string) (bool, error)

func (*S3Fs) FileGet

func (fs *S3Fs) FileGet(folder, name string, opts FileGetOptions) ([]byte, error)

func (*S3Fs) FileList

func (fs *S3Fs) FileList(folder, name string) ([]os.DirEntry, error)

func (*S3Fs) FileOpenRead

func (fs *S3Fs) FileOpenRead(folder, name string, opts FileGetOptions) (io.ReadCloser, string, error)

func (*S3Fs) FilePut

func (fs *S3Fs) FilePut(folder, name string, data []byte, opts FilePutOptions) error

func (*S3Fs) FileRead

func (fs *S3Fs) FileRead(folder, name string, w io.Writer, size int64, opts FileGetOptions) error

func (*S3Fs) FileStat

func (fs *S3Fs) FileStat(folder, name string, opts FileStatOptions) (os.FileInfo, error)

func (*S3Fs) FileWrite

func (fs *S3Fs) FileWrite(folder, name string, r io.Reader, size int64, opts FilePutOptions) error

func (*S3Fs) FolderCreate

func (fs *S3Fs) FolderCreate(folder string, opts FolderCreateOptions) error

func (*S3Fs) FolderExists

func (fs *S3Fs) FolderExists(folder string) (bool, error)

func (*S3Fs) Protocol

func (fs *S3Fs) Protocol() string

func (*S3Fs) String

func (fs *S3Fs) String() string

Jump to

Keyboard shortcuts

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