filesystem

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 3

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 FileGetOptions

type FileGetOptions struct {
	VersionID string
}

GetObjectOptions represents options specified by user for GetObject call

type FilePutOptions

type FilePutOptions struct {
	Progress    io.Reader
	ContentType string
}

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, error)
	FileStat(folder, name string, opts FileStatOptions) (os.FileInfo, error)
	String() string
	Protocol() string
}

type FolderCreateOptions

type FolderCreateOptions struct {
	ObjectLocking bool
}

type GitFs

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

func NewGitFs

func NewGitFs(basepath string, logger *logging.Logger) (*GitFs, error)

func (*GitFs) Commit

func (fs *GitFs) Commit(msg, name, email string) error

func (*GitFs) FileExists

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

func (*GitFs) FileGet

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

func (*GitFs) FileOpenRead

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

func (*GitFs) FilePut

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

func (*GitFs) FileRead

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

func (*GitFs) FileStat

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

func (*GitFs) FileWrite

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

func (*GitFs) FolderCreate

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

func (*GitFs) FolderExists

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

func (*GitFs) Open

func (fs *GitFs) Open() error

func (*GitFs) String

func (fs *GitFs) String() string

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 (fs *LocalFs) FileExists(folder, name string) (bool, error)

func (*LocalFs) FileGet

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

func (*LocalFs) FileOpenRead

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

func (*LocalFs) FilePut

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

func (*LocalFs) FileRead

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

func (*LocalFs) FileStat

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

func (*LocalFs) FileWrite

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

func (*LocalFs) FolderCreate

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

func (*LocalFs) FolderExists

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

func (*LocalFs) Protocol

func (fs *LocalFs) Protocol() string

func (*LocalFs) String

func (fs *LocalFs) String() string

type NotFoundError

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

func (*NotFoundError) Error

func (nf *NotFoundError) Error() string

type S3FileInfo

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

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,
	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) FileOpenRead

func (fs *S3Fs) FileOpenRead(folder, name string, opts FileGetOptions) (io.ReadCloser, 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