minfs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package minfs contains the MinFS core package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir

func CacheDir(path string) func(*Config)

CacheDir - cache directory path option for Config

func Debug

func Debug() func(*Config)

Debug - enables debug logging.

func Insecure

func Insecure() func(*Config)

Insecure - enable insecure mode.

func Mountpoint

func Mountpoint(mountpoint string) func(*Config)

Mountpoint configures the target mountpoint

func SetGID

func SetGID(gid uint32) func(*Config)

SetGID - sets a custom gid for the mount.

func SetUID

func SetUID(uid uint32) func(*Config)

SetUID - sets a custom uid for the mount.

func Target

func Target(target string) func(*Config)

Target url target option for Config

Types

type AccessConfig

type AccessConfig struct {
	Version     string `json:"version"`
	AccessKey   string `json:"accessKey"`
	SecretKey   string `json:"secretKey"`
	SecretToken string `json:"secretToken"`
}

AccessConfig - access credentials and version of `config.json`.

func InitMinFSConfig

func InitMinFSConfig() (*AccessConfig, error)

InitMinFSConfig - Initialize MinFS configuration file.

type Config

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

Config is being used for storge of configuration items

type CopyOperation

type CopyOperation struct {
	*Operation

	Source string
	Target string
}

CopyOperation - Copy source object to target.

type Dir

type Dir struct {
	Path  string
	Inode uint64
	Mode  os.FileMode

	Size uint64
	ETag string

	Atime time.Time
	Mtime time.Time

	UID uint32
	GID uint32

	// OS X only
	Bkuptime time.Time
	Chgtime  time.Time
	Crtime   time.Time
	Flags    uint32 // see chflags(2)
	// contains filtered or unexported fields
}

Dir implements both Node and Handle for the root directory.

func (*Dir) Attr

func (dir *Dir) Attr(ctx context.Context, a *fuse.Attr) error

Attr returns the attributes for the directory

func (*Dir) Create

func (dir *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fs.Node, fs.Handle, error)

Create will return a new empty file in current dir, if the file is currently locked, it will wait for the lock to be freed.

func (*Dir) Dirent

func (dir *Dir) Dirent() fuse.Dirent

Dirent will return the fuse Dirent for current dir

func (*Dir) FullPath

func (dir *Dir) FullPath() string

FullPath returns the full path including parent paths for current dir

func (*Dir) Lookup

func (dir *Dir) Lookup(ctx context.Context, name string) (fs.Node, error)

Lookup returns the file node, and scans the current dir if necessary

func (*Dir) Mkdir

func (dir *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, error)

Mkdir will make a new directory below current dir

func (*Dir) ReadDirAll

func (dir *Dir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

ReadDirAll will return all files in current dir

func (*Dir) RemotePath

func (dir *Dir) RemotePath() string

RemotePath returns the full path including parent paths for current dir on the remote

func (*Dir) Remove

func (dir *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) error

Remove will delete a file or directory from current directory

func (*Dir) Rename

func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, nd fs.Node) error

Rename will rename files

type File

type File struct {
	Path string

	Inode uint64

	Mode os.FileMode

	Size uint64
	ETag string

	Atime time.Time
	Mtime time.Time

	UID uint32
	GID uint32

	// OS X only
	Bkuptime time.Time
	Chgtime  time.Time
	Crtime   time.Time
	Flags    uint32 // see chflags(2)

	Hash []byte
	// contains filtered or unexported fields
}

File implements both Node and Handle for the hello file.

func (*File) Attr

func (f *File) Attr(ctx context.Context, a *fuse.Attr) error

Attr - attr file context.

func (*File) Dirent

func (f *File) Dirent() fuse.Dirent

Dirent returns the File object as a fuse.Dirent

func (*File) Fsync

func (f *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) error

Fsync because of bug in fuse lib, this is on file. -- FIXME - needs more context (y4m4).

func (*File) FullPath

func (f *File) FullPath() string

FullPath will return the full path

func (*File) Getattr

func (f *File) Getattr(ctx context.Context, req *fuse.GetattrRequest, resp *fuse.GetattrResponse) error

Getattr returns the file attributes

func (*File) Open

func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error)

Open return a file handle of the opened file

func (*File) RemotePath

func (f *File) RemotePath() string

RemotePath will return the full path on bucket

func (*File) Setattr

func (f *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error

Setattr - set attribute.

type FileHandle

type FileHandle struct {
	// the os file handle
	*os.File
	// contains filtered or unexported fields
}

FileHandle - Contains an opened file which can be read from and written to

func (*FileHandle) Flush

func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error

Flush - experimenting with uploading at flush, this slows operations down till it has been completely flushed

func (*FileHandle) Read

func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error

Read from the file handle

func (*FileHandle) Release

func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) error

Release the file handle

func (*FileHandle) Write

func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error

Write to the file handle

type MinFS

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

MinFS contains the meta data for the MinFS client

func New

func New(options ...func(*Config)) (*MinFS, error)

New will return a new MinFS client

func (*MinFS) Acquire

func (mfs *MinFS) Acquire(f *File) (*FileHandle, error)

Acquire will return a new FileHandle

func (*MinFS) IsLocked

func (mfs *MinFS) IsLocked(path string) bool

IsLocked returns if the path is currently locked

func (*MinFS) Lock

func (mfs *MinFS) Lock(path string) error

Lock - acquires a lock at path.

func (*MinFS) NewCachePath

func (mfs *MinFS) NewCachePath() (string, error)

NewCachePath -

func (*MinFS) NextSequence

func (mfs *MinFS) NextSequence(tx *meta.Tx) (sequence uint64, err error)

NextSequence will return the next free iNode

func (*MinFS) Release

func (mfs *MinFS) Release(fh *FileHandle) error

Release release the filehandle

func (*MinFS) Root

func (mfs *MinFS) Root() (fs.Node, error)

Root is the root folder of the MinFS mountpoint

func (*MinFS) Serve

func (mfs *MinFS) Serve() (err error)

Serve starts the MinFS client

func (*MinFS) Statfs

func (mfs *MinFS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) error

Statfs will return meta information on the minio filesystem

func (*MinFS) Unlock

func (mfs *MinFS) Unlock(path string) error

Unlock - unlock the lock at path.

type MoveOperation

type MoveOperation struct {
	*Operation

	Source string
	Target string
}

MoveOperation - Move source object to target object. Copy source to target, delete the source.

type Operation

type Operation struct {
	Error chan error
}

Operation -

type PutOperation

type PutOperation struct {
	*Operation

	Length int64

	Source string
	Target string
}

PutOperation - Copy source file to target.

type Storer

type Storer interface {
	// contains filtered or unexported methods
}

Storer -

Jump to

Keyboard shortcuts

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