union

package
v4.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package union offers a simple http.FileSystem that can unify multiple filesystems at various mount points. Copied from https://github.com/shurcooL/httpfs/blob/master/union/union.go due to import issues

Example
Output:

/
/fs0
/fs0/a-file.txt
/fs0/another-file.txt
/fs0/folderA
/fs0/folderA/entry-A.txt
/fs0/folderA/entry-B.txt
/fs0/zzz-last-file.txt
/fs1
/fs1/folderA
/fs1/folderA/file1.txt
/fs1/folderA/file2.txt
/fs1/folderB
/fs1/folderB/folderC
/fs1/folderB/folderC/file3.txt
/fs1/not-worth-compressing-file.txt
/fs1/sample-file.txt
Example (Empty)
Output:

/
Example (NotExist)
Output:

os.IsNotExist: true
open /does-not-exist: file does not exist

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(mapping map[string]http.FileSystem) http.FileSystem

New creates an union filesystem with the provided mapping of mount points to filesystems.

Each mount point must be of form "/mydir". It must start with a '/', and contain a single directory name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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