Categorygithub.com/go-corelibs/hrx
modulepackage
1.1.4
Repository: https://github.com/go-corelibs/hrx.git
Documentation: pkg.go.dev

# README

godoc codecov Go Report Card

hrx - human readable archive utilities

A collection of utilities for working with .hrx files.

Installation

> go get github.com/go-corelibs/hrx@latest

Examples

Archive

func main() {
    a := hrx.New("", "file-level comment")
    _ = a.Set("file.txt", "this is a simple test file\nwith multiple lines")
    if err := a.WriteFile("/path/to/new.hrx"); err != nil {
        panic(err)
    }
    // there is now a /path/to/new.hrx with one file.txt archived
}

Go-CoreLibs

Go-CoreLibs is a repository of shared code between the Go-Curses and Go-Enjin projects.

License

Copyright 2024 The Go-CoreLibs Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use file except in compliance with the License.
You may obtain a copy of the license at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

# Functions

AsError is a convenience wrapper around errors.As for an *Error.
New creates a new Archive instance with a DefaultBoundary.
NewScanner constructs a new Scanner instance.
ParseData parses the given data and associates the resulting Archive with the filename given.
ParseFile reads the given file and creates an Archive instance.
ParseReader parses data from the given reader and associates the resulting Archive with the filename given.

# Constants

DefaultBoundary is the boundary size for New archives created.
OpAppended is the ReporterFn note used when a file is appended to an Archive instance during Archive.Set.
OpBoundary is the ReporterFn note used when the Archive boundary is changed.
OpCreated is the ReporterFn note used when creating a directory.
OpDeleted is the ReporterFn note used when a file is deleted from an Archive instance.
OpExtracted is the ReporterFn note used when a file is extracted.
OpSkipped is the ReporterFn note used when a file is skipped from extraction because it was not included with the other pathnames given for specific extraction.
OpUpdated is the ReporterFn note used when a file is updated within an Archive instance during Archive.Set.

# Variables

DefaultFileMode is the os.FileMode setting used to extract files.
Specific error messages.
Specific error messages.
HRX specification errors.
Specific error messages.
Specific error messages.
HRX specification errors.
General package errors.
HRX specification errors.
Specific error messages.
Specific error messages.
HRX specification errors.
Specific error messages.
Specific error messages.
HRX specification errors.
Specific error messages.
Specific error messages.
Specific error messages.
HRX specification errors.
Specific error messages.

# Structs

Error is the type for all error instances returned from this package.
Scanner is a line-reading text scanner for parsing HRX archive contents.

# Interfaces

Archive is a computer-readable parsing of a human-readable archive.
Entry
Entry is a read-only interface for a specific HRX entry.

# Type aliases

ReporterFn is the function signature for Archive progress reporting.