muxfs

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 7 Imported by: 7

Documentation

Index

Constants

View Source
const FilestoreType = "mux"

FilestoreType uniquely identifies the mux filestore

Variables

This section is empty.

Functions

func KnownFSTypes added in v0.6.0

func KnownFSTypes() []string

KnownFSTypes gives the set of filesystems known to muxfs.New

Types

type Mux

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

Mux multiplexes together multiple filesystems using path multiplexing. It's a way to use multiple filesystem implementations as a single FS

func New added in v0.4.2

func New(ctx context.Context, cfgs []qfs.Config) (*Mux, error)

New creates a new Mux Filesystem, if no Option funcs are provided, New uses a default set of Option funcs. Any Option functions passed to this function must check whether their fields are nil or not. The first configured filesystem that implements the qfs.AddingFS interface becomes the default filesystem returned by DefaultWriteFS

func (*Mux) DefaultWriteFS added in v0.4.2

func (m *Mux) DefaultWriteFS() qfs.Filesystem

DefaultWriteFS gives the muxer's configured write destination

func (*Mux) Delete added in v0.4.2

func (m *Mux) Delete(ctx context.Context, path string) (err error)

Delete removes a file or directory from the filesystem

func (*Mux) Done added in v0.4.2

func (m *Mux) Done() <-chan struct{}

Done implements the qfs.ReleasingFilesystem interface

func (*Mux) DoneErr added in v0.4.2

func (m *Mux) DoneErr() error

DoneErr will return any error value after the done channel is closed

func (*Mux) Filesystem added in v0.4.2

func (m *Mux) Filesystem(fsType string) qfs.Filesystem

Filesystem returns the filesystem for a given fs type string, nil if no filesystem for fsType exists

func (*Mux) Get

func (m *Mux) Get(ctx context.Context, path string) (qfs.File, error)

Get a path

func (*Mux) Has added in v0.6.0

func (m *Mux) Has(ctx context.Context, path string) (bool, error)

Has returns whether the store has a File with the given path

func (*Mux) Put added in v0.4.2

func (m *Mux) Put(ctx context.Context, file qfs.File) (resPath string, err error)

Put places a file or directory on the filesystem, returning the root path. The returned path may or may not honor the path of the given file

func (*Mux) SetFilesystem added in v0.4.2

func (m *Mux) SetFilesystem(fs qfs.Filesystem) error

SetFilesystem designates the resolver for a given path kind string

func (*Mux) Type added in v0.4.2

func (m *Mux) Type() string

Type distinguishes this filesystem from others by a unique string prefix

Jump to

Keyboard shortcuts

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