rapi

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2023 License: BSD-2-Clause Imports: 30 Imported by: 1

README

rapi

This is a repository inspired by the restic/restic project. My goal of this project is to build some tooling for restic repositories.

WARNING

DO NOT USE THIS FOR PRODUCTION. It's a hobby project.

Documentation

Index

Constants

View Source
const TimeFormat = "2006-01-02 15:04:05"

TimeFormat is the format used for all timestamps printed by restic.

Variables

View Source
var DefaultOptions = RepositoryOptions{
	Stdout: os.Stdout,
	Stderr: os.Stderr,
}

Functions

func OpenRepository

func OpenRepository(ctx context.Context, opts RepositoryOptions) (*repository.Repository, error)

OpenRepository reads the password and opens the repository.

func Print

func Print(args ...interface{})

Print writes the message to the configured Stdout stream.

func Printf

func Printf(format string, args ...interface{})

Printf writes the message to the configured Stdout stream.

func Println

func Println(args ...interface{})

Println writes the message to the configured Stdout stream.

func ReadRepo

func ReadRepo(opts RepositoryOptions) (string, error)

func Verbosef

func Verbosef(format string, args ...interface{})

Verbosef calls Printf to write the message when the verbose flag is set.

func Verboseff

func Verboseff(format string, args ...interface{})

Verboseff calls Printf to write the message when the verbosity is >= 2

func Warnf

func Warnf(format string, args ...interface{})

Warnf writes the message to the configured Stderr stream.

Types

type RepositoryOptions

type RepositoryOptions struct {
	Repo            string
	RepositoryFile  string
	PasswordFile    string
	PasswordCommand string
	KeyHint         string
	Quiet           bool
	Verbose         int
	NoLock          bool
	JSON            bool
	CacheDir        string
	NoCache         bool
	CleanupCache    bool
	Compression     repository.CompressionMode
	PackSize        uint

	backend.TransportOptions
	limiter.Limits

	Password string
	Stdout   io.Writer
	Stderr   io.Writer

	// verbosity is set as follows:
	//  0 means: don't print any messages except errors, this is used when --quiet is specified
	//  1 is the default: print essential messages
	//  2 means: print more messages, report minor things, this is used when --verbose is specified
	//  3 means: print very detailed debug messages, this is used when --verbose=2 is specified
	Verbosity uint

	Options []string

	Extended options.Options
	// contains filtered or unexported fields
}

RepositoryOptions hold all global options for restic.

Directories

Path Synopsis
Package backend provides local and remote storage for restic repositories.
Package backend provides local and remote storage for restic repositories.
b2
gs
Package gs provides a restic backend for Google Cloud Storage.
Package gs provides a restic backend for Google Cloud Storage.
local
Package local implements repository storage in a local directory.
Package local implements repository storage in a local directory.
location
Package location implements parsing the restic repository location from a string.
Package location implements parsing the restic repository location from a string.
mem
s3
sema
Package sema implements semaphores.
Package sema implements semaphores.
sftp
Package sftp implements repository storage in a directory on a remote server via the sftp protocol.
Package sftp implements repository storage in a directory on a remote server via the sftp protocol.
test
Package test contains a test suite with benchmarks for restic backends.
Package test contains a test suite with benchmarks for restic backends.
Package crypto provides all cryptographic operations needed in restic.
Package crypto provides all cryptographic operations needed in restic.
internal
archiver
Package archiver contains the code which reads files, splits them into chunks and saves the data to the repository.
Package archiver contains the code which reads files, splits them into chunks and saves the data to the repository.
debug
Package debug provides an infrastructure for logging debug information and breakpoints.
Package debug provides an infrastructure for logging debug information and breakpoints.
errors
Package errors provides custom error types used within restic.
Package errors provides custom error types used within restic.
filter
Package filter implements filters for files similar to filepath.Glob, but in contrast to filepath.Glob a pattern may specify directories.
Package filter implements filters for files similar to filepath.Glob, but in contrast to filepath.Glob a pattern may specify directories.
fs
Package fs implements an OS independent abstraction of a file system suitable for backup purposes.
Package fs implements an OS independent abstraction of a file system suitable for backup purposes.
migrations
Package migrations contains migrations that can be applied to a repository and/or backend.
Package migrations contains migrations that can be applied to a repository and/or backend.
restorer
Package restorer contains code to restore data from a repository.
Package restorer contains code to restore data from a repository.
test
Package test provides helper functions for writing tests for restic.
Package test provides helper functions for writing tests for restic.
textfile
Package textfile allows reading files that contain text.
Package textfile allows reading files that contain text.
Package pack provides functions for combining and parsing pack files.
Package pack provides functions for combining and parsing pack files.
Package repository implements a restic repository on top of a backend.
Package repository implements a restic repository on top of a backend.
Package restic is the top level package for the restic backup program, please see https://github.com/restic/restic for more information.
Package restic is the top level package for the restic backup program, please see https://github.com/restic/restic for more information.
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL