All Projects → src-d → Go Billy

src-d / Go Billy

Licence: apache-2.0
The missing interface filesystem abstraction for Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Billy

Lexical.FileSystem
Virtual IFileSystem interfaces, and implementations.
Stars: ✭ 24 (-86.96%)
Mutual labels:  filesystem, abstraction
Enchilada
Enchilada is a filesystem abstraction layer written in C#
Stars: ✭ 29 (-84.24%)
Mutual labels:  filesystem, abstraction
Gen rmq
Elixir AMQP consumer and publisher behaviours
Stars: ✭ 146 (-20.65%)
Mutual labels:  abstraction
Tus Ruby Server
Ruby server for tus resumable upload protocol
Stars: ✭ 172 (-6.52%)
Mutual labels:  filesystem
Onedriver
A native Linux filesystem for Microsoft OneDrive
Stars: ✭ 163 (-11.41%)
Mutual labels:  filesystem
Filesystem
FileSystem is an application that allows you to browse the content of your iPhone disk, displaying file and folders, files contents, and detailed informations about file and folder permissions.
Stars: ✭ 148 (-19.57%)
Mutual labels:  filesystem
Nohost
A web server in your web browser
Stars: ✭ 164 (-10.87%)
Mutual labels:  filesystem
Xcv
✂️ Cut, Copy and Paste files with Bash
Stars: ✭ 144 (-21.74%)
Mutual labels:  filesystem
Lfs
A thing to get information on your mounted disks
Stars: ✭ 178 (-3.26%)
Mutual labels:  filesystem
Usbmount
Simple set of scripts to automount removable devices for a Linux system
Stars: ✭ 160 (-13.04%)
Mutual labels:  filesystem
Dosa
DOSA is a data object abstraction layer
Stars: ✭ 172 (-6.52%)
Mutual labels:  abstraction
Fselect
Find files with SQL-like queries
Stars: ✭ 3,103 (+1586.41%)
Mutual labels:  filesystem
Android Filebrowser Filepicker
A FileBrowser / FileChooser / FolderChooser for Android that you can integrate to your app to browse/select files from internal/external storage
Stars: ✭ 157 (-14.67%)
Mutual labels:  filesystem
Sharesniffer
Network share sniffer and auto-mounter for crawling remote file systems
Stars: ✭ 168 (-8.7%)
Mutual labels:  filesystem
Flametree
🔥 Python file and zip operations made easy
Stars: ✭ 148 (-19.57%)
Mutual labels:  filesystem
Python Fuse
Python 2.x/3.x bindings for libfuse 2.x
Stars: ✭ 171 (-7.07%)
Mutual labels:  filesystem
Mc
MinIO Client is a replacement for ls, cp, mkdir, diff and rsync commands for filesystems and object storage.
Stars: ✭ 1,962 (+966.3%)
Mutual labels:  filesystem
Flysystem
Abstraction for local and remote filesystems
Stars: ✭ 12,237 (+6550.54%)
Mutual labels:  filesystem
Command
A library to build command line applications using PHP
Stars: ✭ 164 (-10.87%)
Mutual labels:  filesystem
Pdf Archiver
A tool for tagging files and archiving tasks.
Stars: ✭ 182 (-1.09%)
Mutual labels:  filesystem

WE CONTINUE THE DEVELOPMENT AT go-git/go-billy. This repository is abandoned, and no further updates will be done on the code base, nor issue/prs will be answered or attended.

go-billy GoDoc Build Status Build status codecov

The missing interface filesystem abstraction for Go. Billy implements an interface based on the os standard library, allowing to develop applications without dependency on the underlying storage. Makes it virtually free to implement mocks and testing over filesystem operations.

Billy was born as part of src-d/go-git project.

Installation

go get -u gopkg.in/src-d/go-billy.v4/...

Usage

Billy exposes filesystems using the Filesystem interface. Each filesystem implementation gives you a New method, whose arguments depend on the implementation itself, that returns a new Filesystem.

The following example caches in memory all readable files in a directory from any billy's filesystem implementation.

func LoadToMemory(origin billy.Filesystem, path string) (*memory.Memory, error) {
	memory := memory.New()

	files, err := origin.ReadDir("/")
	if err != nil {
		return nil, err
	}

	for _, file := range files {
		if file.IsDir() {
			continue
		}

		src, err := origin.Open(file.Name())
		if err != nil {
			return nil, err
		}

		dst, err := memory.Create(file.Name())
		if err != nil {
			return nil, err
		}

		if _, err = io.Copy(dst, src); err != nil {
			return nil, err
		}

		if err := dst.Close(); err != nil {
			return nil, err
		}

		if err := src.Close(); err != nil {
			return nil, err
		}
	}

	return memory, nil
}

Why billy?

The library billy deals with storage systems and Billy is the name of a well-known, IKEA bookcase. That's it.

License

Apache License Version 2.0, see LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].