mapfs

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	Base      path.Local
	URL       *url.URL
	Files     map[path.Relative]*File
	MaxSize   int64
	UsedBytes int64
}

das könnte man zum kopieren bzw. synchronisieren nehmen

func New

func New(abs path.Absolute) (*FS, error)

func (*FS) Abs

func (m *FS) Abs(r path.Relative) path.Absolute

func (*FS) Delete

func (m *FS) Delete(p path.Relative, recursive bool) error

recursive means, that the content (files and folders) with be also deleted

func (*FS) Drive

func (m *FS) Drive(path.Relative) (path.Local, error)

func (*FS) Exists

func (t *FS) Exists(p path.Relative) bool

func (*FS) FreeSpace

func (d *FS) FreeSpace(p path.Relative) int64

func (*FS) GetMeta

func (m *FS) GetMeta(name path.Relative) (map[string][]byte, error)

func (*FS) GetMode

func (d *FS) GetMode(name path.Relative) (fs.FileMode, error)

func (*FS) Glob

func (fsys *FS) Glob(pattern string) (matches []path.Relative, err error)

func (*FS) HasAllDirs

func (m *FS) HasAllDirs(p path.Relative) bool

func (*FS) HostName

func (f *FS) HostName() string

func (*FS) Mkdirall

func (m *FS) Mkdirall(p path.Relative) error

func (*FS) ModTime

func (m *FS) ModTime(p path.Relative) (t time.Time, err error)

func (*FS) Move

func (m *FS) Move(src path.Relative, targetFolder path.Relative) error

TODO test

func (*FS) Password

func (f *FS) Password() string

func (*FS) Port

func (f *FS) Port() int

func (*FS) ReadFrom

func (t *FS) ReadFrom(fsys fs.FS, p path.Relative) error

TODO collect the errors instead of directly aborting

func (*FS) Reader

func (m *FS) Reader(p path.Relative) (io.ReadCloser, error)

func (*FS) Rename

func (m *FS) Rename(p path.Relative, name string) error

should fail when the new name is not a name but a path

func (*FS) Scheme

func (f *FS) Scheme() string

func (*FS) SetMeta

func (m *FS) SetMeta(name path.Relative, meta map[string][]byte) error

func (*FS) SetMode

func (d *FS) SetMode(name path.Relative, m fs.FileMode) error

func (*FS) Size

func (d *FS) Size(name path.Relative) int64

func (*FS) UserName

func (f *FS) UserName() string

func (*FS) Walk

func (fsys *FS) Walk(root path.Relative, fn fs.WalkFunc) error

func (*FS) Write

func (m *FS) Write(p path.Relative, rd io.ReadCloser, recursive bool) (err error)

func (*FS) WriteTo

func (t *FS) WriteTo(fsys fs.FS) error

TODO collect the errors instead of directly aborting

func (*FS) WriteWithMeta

func (m *FS) WriteWithMeta(p path.Relative, rd io.ReadCloser, meta map[string][]byte, recursive bool) error

func (*FS) WriteWithMode

func (m *FS) WriteWithMode(p path.Relative, rd io.ReadCloser, perm fs.FileMode, recursive bool) (err error)

type File

type File struct {
	FileMode fs.FileMode
	Meta     map[string][]byte
	ModTime  time.Time
	Data     []byte
}

Jump to

Keyboard shortcuts

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