Documentation ¶
Overview ¶
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.
Index ¶
- Variables
- func AddDirectory(v *Volume, from, to string, recursive bool) (int, error)
- func AddFile(v *Volume, from, to string) (int64, error)
- func AddGlob(v *Volume, pattern, to string, recursive bool) (int, error)
- func AddTarContent(v *Volume, file io.Reader, to string) (int, error)
- type File
- func (f *File) Bytes() []byte
- func (f *File) Chdir() error
- func (f *File) Chmod(mode os.FileMode) error
- func (f *File) Chown(uid, gid int) error
- func (f *File) Close() error
- func (f *File) Name() string
- func (f *File) Read(b []byte) (int, error)
- func (f *File) Stat() (os.FileInfo, error)
- func (f *File) String() string
- func (f *File) Sync() error
- func (f *File) Truncate(size int64) error
- func (f *File) Write(b []byte) (int, error)
- func (f *File) WriteString(s string) (int, error)
- type FileInfo
- type Inode
- type Volume
- func (v *Volume) Chdir(dir string) error
- func (v *Volume) Chmod(name string, mode os.FileMode) error
- func (v *Volume) Chown(name string, uid, gid int) error
- func (v *Volume) Close() error
- func (v *Volume) Create(name string) (file *File, err error)
- func (v *Volume) Find(matcher func(string) bool) []string
- func (v *Volume) Getwd() (dir string, err error)
- func (v *Volume) Open(name string) (file *File, err error)
- func (v *Volume) OpenFile(name string, flag int, perm os.FileMode) (file *File, err error)
- func (v *Volume) Remove(name string) error
- func (v *Volume) RemoveAll(path string) error
- func (v *Volume) Rename(oldpath, newpath string) error
- func (v *Volume) Stat(name string) (os.FileInfo, error)
- func (v *Volume) Truncate(name string, size int64) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddDirectory ¶
AddFile adds a OS directory to a Volume, returns the number of files written
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) Chdir ¶
Chdir changes the current working directory to the file, which must be a directory. If there is an error, it will be of type *PathError.
func (*File) Close ¶
Close closes the File, rendering it unusable for I/O. It returns an error, if any.
type FileInfo ¶
type FileInfo struct {
Inode
}
type Volume ¶
type Volume struct {
// contains filtered or unexported fields
}
func (*Volume) Chmod ¶
Chmod changes the mode of the file to mode. If there is an error, it will be of type *PathError.
func (*Volume) Chown ¶
Chown changes the numeric uid and gid of the named file. If there is an error, it will be of type *PathError.
func (*Volume) Create ¶
Create creates the named file mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *PathError.
func (*Volume) Open ¶
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.
func (*Volume) OpenFile ¶
OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful, methods on the returned File can be used for I/O. If there is an error, it will be of type *PathError.
func (*Volume) Remove ¶
Remove removes the named file or directory. If there is an error, it will be of type *PathError.
func (*Volume) RemoveAll ¶
RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exist, RemoveAll returns nil (no error).