Categorygithub.com/mcuadros/go-raa
modulepackage
1.2.0
Repository: https://github.com/mcuadros/go-raa.git
Documentation: pkg.go.dev

# README

raa - Random Access Archive

Build Status Coverage 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 -u github.com/mcuadros/go-raa/...

Example

Import the package:

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

Create a new archive file respredented by a Archive:

a, err = raa.CreateArchive("example.raa")
if err != nil {
    panic(err)
}

Add a new file to your new Archive:

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

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

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

Command-line interface

raa cli interface, is a convinient command that helps you to creates and manipulates raa files.

Output from: ./raa --help:

Usage:
  raa [OPTIONS] <command>

Help Options:
  -h, --help  Show this help message

Available commands:
  list    List the items contained on a file.
  pack    Create a new archive containing the specified items.
  stats   Display some stats about the file.
  unpack  Extract to disk from the archive.

License

MIT, see LICENSE

# Packages

No description provided by the author
raa cli interface, is a convinient command that helps you to creates and manipulates raa files.

# 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.
CreateArchive create an archive raa file.
OpenArchive open an archive raa file.

# Constants

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

# 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
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