Categorygithub.com/mcuadros/boltfs
modulepackage
0.1.0-beta
Repository: https://github.com/mcuadros/boltfs.git
Documentation: pkg.go.dev

# README

raa - Random Access Archive

Build Status GoDoc GitHub release

raa is a file container, similar to tar or zip, focused on allowing constant-time random file access with linear memory consumption increase.

The library implements a very similar API to the go os package, allowing full control over,and low level acces to the contained files. raa is based on boltdb, a low-level key/value database for Go.

Installation

The recommended way to install raa

go get github.com/mcuadros/go-raa

Example

Import the package:

import "github.com/mcuadros/go-raa"

Create a new archive file respredented by a Volume:

v, err = raa.NewVolume("example.raa")
if err != nil {
    panic(err)
}

Add a new file to your new Volume:

f, _ := v.Create("/hello.txt")
defer f.Close()
f.WriteString("Hello World!")

And now you can read the file contained on the Volume:

f, _ := v.Open("/hello.txt")
defer f.Close()
content, _ := ioutil.ReadAll(f)
fmt.Println(string(content))
//Output: Hello World!

License

MIT, see LICENSE

# Packages

No description provided by the author

# Functions

AddFile adds a OS directory to a Volume, returns the number of files written.
AddFile adds a OS file to a Volume, returns the number of bytes written.
AddGlob adds a OS files and directories to a Volume using a glob pattern, returns the number of files written.
AddTarContent add the contained files in a tar stream to the volume, returns the number of files copied to the Volume.
NewVolume create or open a Volume.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author