sivafs

package module
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

README

go-billy-siva GoDoc Build Status

go-billy-siva is a limit billy filesystem implementation based on siva. The implementation is limited to billy.Basic and billy.Dir, the usage of the billy.helpers is required to be able of use as a full billy.Filesystem

Installation

The recommended way to install go-billy-siva

go get -u gopkg.in/src-d/go-billy-siva.v3/...

License

Apache License 2.0, see LICENSE

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNonSeekableFile          = errors.New("file non-seekable")
	ErrFileWriteModeAlreadyOpen = errors.New("previous file in write mode already open")
	ErrReadOnlyFile             = errors.New("file is read-only")
	ErrWriteOnlyFile            = errors.New("file is write-only")
)

Functions

This section is empty.

Types

type SivaBasicFS

type SivaBasicFS interface {
	billy.Basic
	billy.Dir

	SivaSync
}

func New

func New(fs billy.Filesystem, path string) SivaBasicFS

New creates a new filesystem backed by a siva file with the given path in the given filesystem. The siva file will be opened or created lazily with the first operation.

All files opened in write mode must be closed, otherwise the siva file will be corrupted.

type SivaFS

type SivaFS interface {
	billy.Filesystem
	SivaSync
}

func NewFilesystem

func NewFilesystem(fs billy.Filesystem, path string, tmpFs billy.Filesystem) (SivaFS, error)

NewFilesystem creates an entire filesystem using siva as the main backend, but supplying unsupported functionality using as a temporal files backend the main filesystem. It needs an additional parameter `tmpFs` where temporary files will be stored. Note that `tmpFs` will be mounted as /tmp.

type SivaSync

type SivaSync interface {
	// Sync closes any open files, this method should be called at the end of
	// program to ensure that all the files are properly closed, otherwise the
	// siva file will be corrupted.
	Sync() error
}

Jump to

Keyboard shortcuts

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