Documentation ¶
Overview ¶
Package local implements repository storage in a local directory.
Index ¶
- func ParseConfig(s string) (interface{}, error)
- type Config
- type Local
- func (b *Local) Close() error
- func (b *Local) Connections() uint
- func (b *Local) Delete(ctx context.Context) error
- func (b *Local) HasAtomicReplace() bool
- func (b *Local) Hasher() hash.Hash
- func (b *Local) IsNotExist(err error) bool
- func (b *Local) List(ctx context.Context, t restic.FileType, fn func(restic.FileInfo) error) (err error)
- func (b *Local) Load(ctx context.Context, h restic.Handle, length int, offset int64, ...) error
- func (b *Local) Location() string
- func (b *Local) Remove(ctx context.Context, h restic.Handle) error
- func (b *Local) Save(ctx context.Context, h restic.Handle, rd restic.RewindReader) (err error)
- func (b *Local) Stat(ctx context.Context, h restic.Handle) (restic.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseConfig ¶
ParseConfig parses a local backend config.
Types ¶
type Config ¶
type Config struct { Path string Layout string `option:"layout" help:"use this backend directory layout (default: auto-detect)"` Connections uint `option:"connections" help:"set a limit for the number of concurrent operations (default: 2)"` }
Config holds all information needed to open a local repository.
type Local ¶
Local is a backend in a local directory.
func Create ¶
Create creates all the necessary files and directories for a new local backend at dir. Afterwards a new config blob should be created.
func (*Local) Connections ¶ added in v0.14.0
func (*Local) HasAtomicReplace ¶ added in v0.14.0
HasAtomicReplace returns whether Save() can atomically replace files
func (*Local) Hasher ¶ added in v0.13.0
Hasher may return a hash function for calculating a content hash for the backend
func (*Local) IsNotExist ¶
IsNotExist returns true if the error is caused by a non existing file.
func (*Local) List ¶
func (b *Local) List(ctx context.Context, t restic.FileType, fn func(restic.FileInfo) error) (err error)
List runs fn for each file in the backend which has the type t. When an error occurs (or fn returns an error), List stops and returns it.
func (*Local) Load ¶
func (b *Local) Load(ctx context.Context, h restic.Handle, length int, offset int64, fn func(rd io.Reader) error) error
Load runs fn with a reader that yields the contents of the file at h at the given offset.