util

package
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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultModes = Modes{Dir: 0700, File: 0600}

DefaultModes defines the default permissions to apply to new repository files and directories stored on file-based backends.

Functions

func DefaultDelete

func DefaultDelete(ctx context.Context, be backend.Backend) error

DefaultDelete removes all restic keys in the bucket. It will not remove the bucket itself.

func DefaultLoad

func DefaultLoad(ctx context.Context, h backend.Handle, length int, offset int64,
	openReader func(ctx context.Context, h backend.Handle, length int, offset int64) (io.ReadCloser, error),
	fn func(rd io.Reader) error) error

DefaultLoad implements Backend.Load using lower-level openReader func

func IsErrDot

func IsErrDot(err error) bool

func StartForeground

func StartForeground(cmd *exec.Cmd) (bg func() error, err error)

StartForeground runs cmd in the foreground, by temporarily switching to the new process group created for cmd. The returned function `bg` switches back to the previous process group.

The command's environment has all RESTIC_* variables removed.

Types

type Modes

type Modes struct {
	Dir  os.FileMode
	File os.FileMode
}

func DeriveModesFromFileInfo

func DeriveModesFromFileInfo(fi os.FileInfo, err error) Modes

DeriveModesFromFileInfo will, given the mode of a regular file, compute the mode we should use for new files and directories. If the passed error is non-nil DefaultModes are returned.

Jump to

Keyboard shortcuts

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