Documentation ¶
Index ¶
- Variables
- type SivaBasicFS
- type SivaFS
- func NewFilesystem(fs billy.Filesystem, path string, tmpFs billy.Filesystem) (SivaFS, error)
- func NewFilesystemReadOnly(fs billy.Filesystem, path string, offset uint64) (SivaFS, error)
- func NewFilesystemWithOptions(fs billy.Filesystem, path string, tmpFs billy.Filesystem, o SivaFSOptions) (SivaFS, error)
- type SivaFSOptions
- type SivaSync
Constants ¶
This section is empty.
Variables ¶
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") ErrReadOnlyFilesystem = errors.New("filesystem is read-only") ErrOffsetReadWrite = errors.New("can only specify the offset in a read only filesystem") )
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.
func NewWithOptions ¶ added in v4.5.0
func NewWithOptions(fs billy.Filesystem, path string, o SivaFSOptions) SivaBasicFS
NewWithOptions creates a new siva backed filesystem and accepts options. See New documentation.
type SivaFS ¶
type SivaFS interface { billy.Filesystem SivaSync }
func NewFilesystem ¶
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.
func NewFilesystemReadOnly ¶ added in v4.4.0
NewFilesystemReadOnly creates a read only filesystem backed by a siva file. offset is the index offset inside the siva file. Set it to 0 to use the last index.
func NewFilesystemWithOptions ¶ added in v4.5.0
func NewFilesystemWithOptions( fs billy.Filesystem, path string, tmpFs billy.Filesystem, o SivaFSOptions, ) (SivaFS, error)
NewFilesystemWithOptions creates an entire filesystem siva as the main backend. It accepts options. See NewFilesystem documentation.
type SivaFSOptions ¶ added in v4.5.0
type SivaFSOptions struct { // UnsafePaths set to on does not sanitize file paths. UnsafePaths bool // ReadOnly opens the siva file in read only mode. ReadOnly bool // Offset specifies the offset of the index. If it is 0 then the latest // index is used. This is only usable in read only mode. Offset uint64 }
SivaFSOptions holds configuration options for the filesystem.