Documentation ¶
Overview ¶
Package local implements repository storage in a local directory.
Index ¶
- func ParseConfig(cfg string) (interface{}, error)
- type Config
- type Local
- func (b *Local) Close() error
- func (b *Local) Delete() error
- func (b *Local) IsNotExist(err error) bool
- func (b *Local) List(ctx context.Context, t restic.FileType) <-chan string
- func (b *Local) Load(ctx context.Context, h restic.Handle, length int, offset int64) (io.ReadCloser, 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 io.Reader) (err error)
- func (b *Local) Stat(ctx context.Context, h restic.Handle) (restic.FileInfo, error)
- func (b *Local) Test(ctx context.Context, h restic.Handle) (bool, 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)"` }
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) IsNotExist ¶
IsNotExist returns true if the error is caused by a non existing file.
func (*Local) List ¶
List returns a channel that yields all names of blobs of type t. A goroutine is started for this.
func (*Local) Load ¶
func (b *Local) Load(ctx context.Context, h restic.Handle, length int, offset int64) (io.ReadCloser, error)
Load returns a reader that yields the contents of the file at h at the given offset. If length is nonzero, only a portion of the file is returned. rd must be closed after use.