filesystem

package
v0.0.0-...-18b9f3e Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPath

func AbsPath(cwd, path string) (string, error)

func CleanupAbsPath

func CleanupAbsPath(path string) (string, error)

func DirUp

func DirUp(abs_path string) (string, string, error)

func ListUpdateDoc

func ListUpdateDoc(doc_key, tag_name, op string) (bson.M, error)

func UpdateTagList

func UpdateTagList(old_tags []string, tag_name, op string) ([]string, error)

Types

type ErrLookupStop

type ErrLookupStop struct {
	LastSuccessfulPath string
	LastEntry          types.FsEntry
	Reason             error
}

func (ErrLookupStop) Error

func (e ErrLookupStop) Error() string

func (ErrLookupStop) Unwrap

func (e ErrLookupStop) Unwrap() error

type FSContext

type FSContext struct {
	Store    Store
	UserTags []string
}

func (*FSContext) Open

func (c *FSContext) Open(ctx context.Context, path string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)

func (*FSContext) Stat

func (c *FSContext) Stat(ctx context.Context, path string) (sh.FileInfo, error)

type RdonlyFileStream

type RdonlyFileStream struct {
	Stream *gridfs.DownloadStream
}

func (RdonlyFileStream) Close

func (r RdonlyFileStream) Close() error

func (RdonlyFileStream) Read

func (r RdonlyFileStream) Read(p []byte) (int, error)

func (RdonlyFileStream) Write

func (r RdonlyFileStream) Write(p []byte) (int, error)

type RdwrFileStream

type RdwrFileStream struct {
	ReadStream  io.ReadWriteCloser
	WriteStream io.ReadWriteCloser
}

func (*RdwrFileStream) Close

func (r *RdwrFileStream) Close() error

func (*RdwrFileStream) Read

func (r *RdwrFileStream) Read(p []byte) (int, error)

func (*RdwrFileStream) Write

func (r *RdwrFileStream) Write(p []byte) (int, error)

type Store

type Store struct {
	Col    *mongo.Collection
	Bucket *gridfs.Bucket
}

func (Store) Chmod

func (s Store) Chmod(ctx context.Context, path string, tags []string, tag_name, op string, perm types.FsAccessMode, recursive bool) (*types.FsEntry, error)

func (Store) Copy

func (s Store) Copy(ctx context.Context, dest_path, src_path string, tags []string, recursive bool) (*types.FsEntry, error)

func (Store) Lookup

func (s Store) Lookup(ctx context.Context, tags []string, abs_path string) (*types.FsEntry, error)

func (Store) LookupRead

func (s Store) LookupRead(ctx context.Context, abs_path string, tags []string) (io.ReadCloser, error)

func (Store) LookupReadAll

func (s Store) LookupReadAll(ctx context.Context, abs_path string, tags []string) ([]byte, error)

func (Store) Mkdir

func (s Store) Mkdir(ctx context.Context, abs_path string, tags []string, perms *types.FsEntryPermissions, mkParents bool) (*types.FsEntry, error)

func (Store) Move

func (s Store) Move(ctx context.Context, dest_path, src_path string, tags []string) (*types.FsEntryReference, error)

func (Store) OpenHandler

func (s Store) OpenHandler(user_tags []string) interp.OpenHandlerFunc

func (Store) ReadFile

func (s Store) ReadFile(ctx context.Context, ID primitive.ObjectID, tags []string) (io.ReadCloser, error)

func (Store) ReadFileObj

func (s Store) ReadFileObj(ctx context.Context, file types.FsEntry, tags []string) (io.ReadCloser, error)

func (Store) RemoveChild

func (s Store) RemoveChild(ctx context.Context, parentID primitive.ObjectID, childName string, tags []string) (*types.FsEntry, error)

func (Store) RemoveFile

func (s Store) RemoveFile(ctx context.Context, abs_path string, tags []string, force, rmDirectories bool) (*types.FsEntry, error)

func (Store) StatHandler

func (s Store) StatHandler(user_tags []string) interp.StatHandlerFunc

func (Store) WriteDirectory

func (s Store) WriteDirectory(ctx context.Context, parentID primitive.ObjectID, directoryName string, tags []string, dirTags *types.FsEntryPermissions) (*types.FsEntry, error)

func (Store) WriteFile

func (s Store) WriteFile(ctx context.Context, parentID primitive.ObjectID, name string, fileRef primitive.ObjectID, tags []string) (*types.FsEntry, error)

type WronlyFileStream

type WronlyFileStream struct {
	FileRef, ParentID primitive.ObjectID
	Stream            *gridfs.UploadStream
	Store             Store
	FileName          string
	UserTags          []string
}

func (*WronlyFileStream) Close

func (w *WronlyFileStream) Close() error

func (*WronlyFileStream) Read

func (w *WronlyFileStream) Read(p []byte) (int, error)

func (*WronlyFileStream) Write

func (w *WronlyFileStream) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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