Categorygithub.com/staartwind/resticgo
repositorypackage
1.1.0
Repository: https://github.com/staartwind/resticgo.git
Documentation: pkg.go.dev

# README

Resticgo

Minimal Go wrapper around the restic backup cli.

Installation

go get github.com/staartwind/resticgo

Alternatively the same can be achieved if you use import in a package:

import "github.com/staartwind/resticgo"

Usage

import "github.com/staartwind/resticgo"

Configuration is done using the builder pattern. Every usual restic config for each command is implemented. Have a look at the code to configure it

resticClient := resticgo.NewRestic(resticgo.WithoutCache)

// Get all the snapshots
snapshots, err := resticClient.Snapshots()
if err != nil {
	panic(err)
}

for _, elem := range snapshots {
	fmt.Println(elem)
}

TODO:

  • Make the json responses typed using structs, maybe not because we cannot be sure which restic version is being used
  • Add unit tests