mirror of
https://github.com/restic/restic.git
synced 2025-08-13 21:30:00 +00:00
Run goimports
This commit is contained in:
@@ -4,12 +4,13 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
"path"
|
||||
"restic"
|
||||
"strings"
|
||||
|
||||
"restic/backend"
|
||||
"restic/debug"
|
||||
"restic/errors"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"github.com/restic/restic/internal/backend"
|
||||
"github.com/restic/restic/internal/debug"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"github.com/kurin/blazer/b2"
|
||||
)
|
||||
|
@@ -7,11 +7,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"restic"
|
||||
"restic/backend/b2"
|
||||
"restic/backend/test"
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/backend/b2"
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
|
||||
. "restic/test"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func newB2TestSuite(t testing.TB) *test.Suite {
|
||||
|
@@ -5,8 +5,8 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"restic/errors"
|
||||
"restic/options"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/options"
|
||||
)
|
||||
|
||||
// Config contains all configuration necessary to connect to an b2 compatible
|
||||
|
@@ -3,8 +3,9 @@ package backend
|
||||
import (
|
||||
"net"
|
||||
"net/http"
|
||||
"restic/debug"
|
||||
"time"
|
||||
|
||||
"github.com/restic/restic/internal/debug"
|
||||
)
|
||||
|
||||
// Transport returns a new http.RoundTripper with default settings applied.
|
||||
|
@@ -5,10 +5,11 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"restic"
|
||||
"restic/debug"
|
||||
"restic/errors"
|
||||
"restic/fs"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/debug"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/fs"
|
||||
)
|
||||
|
||||
// Layout computes paths for file name storage.
|
||||
|
@@ -2,7 +2,8 @@ package backend
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"restic"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
)
|
||||
|
||||
// DefaultLayout implements the default layout for local and sftp backends, as
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package backend
|
||||
|
||||
import "restic"
|
||||
import "github.com/restic/restic/internal"
|
||||
|
||||
// RESTLayout implements the default layout for the REST protocol.
|
||||
type RESTLayout struct {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package backend
|
||||
|
||||
import "restic"
|
||||
import "github.com/restic/restic/internal"
|
||||
|
||||
// S3LegacyLayout implements the old layout used for s3 cloud storage backends, as
|
||||
// described in the Design document.
|
||||
|
@@ -5,10 +5,11 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"restic"
|
||||
. "restic/test"
|
||||
"sort"
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func TestDefaultLayout(t *testing.T) {
|
||||
|
@@ -3,8 +3,8 @@ package local
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"restic/errors"
|
||||
"restic/options"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/options"
|
||||
)
|
||||
|
||||
// Config holds all information needed to open a local repository.
|
||||
|
@@ -3,9 +3,10 @@ package local
|
||||
import (
|
||||
"context"
|
||||
"path/filepath"
|
||||
"restic"
|
||||
. "restic/test"
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func TestLayout(t *testing.T) {
|
||||
|
@@ -5,13 +5,14 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"restic"
|
||||
|
||||
"restic/errors"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"restic/backend"
|
||||
"restic/debug"
|
||||
"restic/fs"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"github.com/restic/restic/internal/backend"
|
||||
"github.com/restic/restic/internal/debug"
|
||||
"github.com/restic/restic/internal/fs"
|
||||
)
|
||||
|
||||
// Local is a backend in a local directory.
|
||||
|
@@ -2,12 +2,13 @@ package local_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"restic"
|
||||
"testing"
|
||||
|
||||
"restic/backend/local"
|
||||
"restic/backend/test"
|
||||
. "restic/test"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"github.com/restic/restic/internal/backend/local"
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func newTestSuite(t testing.TB) *test.Suite {
|
||||
|
@@ -4,7 +4,8 @@ package local
|
||||
|
||||
import (
|
||||
"os"
|
||||
"restic/fs"
|
||||
|
||||
"github.com/restic/restic/internal/fs"
|
||||
)
|
||||
|
||||
// set file to readonly
|
||||
|
@@ -4,13 +4,13 @@ package location
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"restic/backend/b2"
|
||||
"restic/backend/local"
|
||||
"restic/backend/rest"
|
||||
"restic/backend/s3"
|
||||
"restic/backend/sftp"
|
||||
"restic/backend/swift"
|
||||
"restic/errors"
|
||||
"github.com/restic/restic/internal/backend/b2"
|
||||
"github.com/restic/restic/internal/backend/local"
|
||||
"github.com/restic/restic/internal/backend/rest"
|
||||
"github.com/restic/restic/internal/backend/s3"
|
||||
"github.com/restic/restic/internal/backend/sftp"
|
||||
"github.com/restic/restic/internal/backend/swift"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
)
|
||||
|
||||
// Location specifies the location of a repository, including the method of
|
||||
|
@@ -5,12 +5,12 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"restic/backend/b2"
|
||||
"restic/backend/local"
|
||||
"restic/backend/rest"
|
||||
"restic/backend/s3"
|
||||
"restic/backend/sftp"
|
||||
"restic/backend/swift"
|
||||
"github.com/restic/restic/internal/backend/b2"
|
||||
"github.com/restic/restic/internal/backend/local"
|
||||
"github.com/restic/restic/internal/backend/rest"
|
||||
"github.com/restic/restic/internal/backend/s3"
|
||||
"github.com/restic/restic/internal/backend/sftp"
|
||||
"github.com/restic/restic/internal/backend/swift"
|
||||
)
|
||||
|
||||
func parseURL(s string) *url.URL {
|
||||
|
@@ -5,12 +5,13 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"restic"
|
||||
"sync"
|
||||
|
||||
"restic/errors"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"restic/debug"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"github.com/restic/restic/internal/debug"
|
||||
)
|
||||
|
||||
type memMap map[restic.Handle][]byte
|
||||
|
@@ -2,13 +2,14 @@ package mem_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"restic"
|
||||
"testing"
|
||||
|
||||
"restic/errors"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"restic/backend/mem"
|
||||
"restic/backend/test"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"github.com/restic/restic/internal/backend/mem"
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
)
|
||||
|
||||
type memConfig struct {
|
||||
|
@@ -4,8 +4,8 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"restic/errors"
|
||||
"restic/options"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/options"
|
||||
)
|
||||
|
||||
// Config contains all configuration necessary to connect to a REST server.
|
||||
|
@@ -9,15 +9,16 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path"
|
||||
"restic"
|
||||
"strings"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"golang.org/x/net/context/ctxhttp"
|
||||
|
||||
"restic/debug"
|
||||
"restic/errors"
|
||||
"github.com/restic/restic/internal/debug"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"restic/backend"
|
||||
"github.com/restic/restic/internal/backend"
|
||||
)
|
||||
|
||||
// make sure the rest backend implements restic.Backend
|
||||
|
@@ -7,13 +7,14 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"restic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"restic/backend/rest"
|
||||
"restic/backend/test"
|
||||
. "restic/test"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"github.com/restic/restic/internal/backend/rest"
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func runRESTServer(ctx context.Context, t testing.TB, dir string) func() {
|
||||
|
@@ -5,8 +5,8 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"restic/errors"
|
||||
"restic/options"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/options"
|
||||
)
|
||||
|
||||
// Config contains all configuration necessary to connect to an s3 compatible
|
||||
|
@@ -7,17 +7,18 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"restic"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"restic/backend"
|
||||
"restic/errors"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"github.com/restic/restic/internal/backend"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"github.com/minio/minio-go"
|
||||
"github.com/minio/minio-go/pkg/credentials"
|
||||
|
||||
"restic/debug"
|
||||
"github.com/restic/restic/internal/debug"
|
||||
)
|
||||
|
||||
// Backend stores data on an S3 endpoint.
|
||||
|
@@ -11,13 +11,14 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"restic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"restic/backend/s3"
|
||||
"restic/backend/test"
|
||||
. "restic/test"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"github.com/restic/restic/internal/backend/s3"
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func mkdir(t testing.TB, dir string) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package backend
|
||||
|
||||
import "restic/errors"
|
||||
import "github.com/restic/restic/internal/errors"
|
||||
|
||||
// Semaphore limits access to a restricted resource.
|
||||
type Semaphore struct {
|
||||
|
@@ -5,8 +5,8 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"restic/errors"
|
||||
"restic/options"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/options"
|
||||
)
|
||||
|
||||
// Config collects all information required to connect to an sftp server.
|
||||
|
@@ -4,10 +4,11 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"restic"
|
||||
"restic/backend/sftp"
|
||||
. "restic/test"
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/backend/sftp"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func TestLayout(t *testing.T) {
|
||||
|
@@ -8,14 +8,15 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"restic"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"restic/errors"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"restic/backend"
|
||||
"restic/debug"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"github.com/restic/restic/internal/backend"
|
||||
"github.com/restic/restic/internal/debug"
|
||||
|
||||
"github.com/pkg/sftp"
|
||||
)
|
||||
|
@@ -5,14 +5,15 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"restic"
|
||||
"restic/backend/sftp"
|
||||
"restic/backend/test"
|
||||
"restic/errors"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
. "restic/test"
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/backend/sftp"
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func findSFTPServerBinary() string {
|
||||
|
@@ -1,8 +1,9 @@
|
||||
package sftp
|
||||
|
||||
import (
|
||||
"restic/errors"
|
||||
"unicode"
|
||||
|
||||
"github.com/restic/restic/internal/errors"
|
||||
)
|
||||
|
||||
// shellSplitter splits a command string into separater arguments. It supports
|
||||
|
@@ -2,9 +2,10 @@ package swift
|
||||
|
||||
import (
|
||||
"os"
|
||||
"restic/errors"
|
||||
"restic/options"
|
||||
"strings"
|
||||
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/options"
|
||||
)
|
||||
|
||||
// Config contains basic configuration needed to specify swift location for a swift server
|
||||
|
@@ -7,13 +7,14 @@ import (
|
||||
"net/http"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"restic"
|
||||
"restic/backend"
|
||||
"restic/debug"
|
||||
"restic/errors"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/backend"
|
||||
"github.com/restic/restic/internal/debug"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"github.com/ncw/swift"
|
||||
)
|
||||
|
||||
|
@@ -4,15 +4,16 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"restic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"restic/errors"
|
||||
. "restic/test"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"restic/backend/swift"
|
||||
"restic/backend/test"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
|
||||
"github.com/restic/restic/internal/backend/swift"
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
)
|
||||
|
||||
func newSwiftTestSuite(t testing.TB) *test.Suite {
|
||||
|
@@ -4,9 +4,10 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"restic"
|
||||
"restic/test"
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func saveRandomFile(t testing.TB, be restic.Backend, length int) ([]byte, restic.Handle) {
|
||||
|
@@ -2,11 +2,12 @@ package test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"restic"
|
||||
"restic/test"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
// Suite implements a test suite for restic backends.
|
||||
|
@@ -9,16 +9,17 @@ import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"reflect"
|
||||
"restic"
|
||||
"restic/errors"
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"restic/test"
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"restic/backend"
|
||||
"github.com/restic/restic/internal/test"
|
||||
|
||||
"github.com/restic/restic/internal/backend"
|
||||
)
|
||||
|
||||
func seedRand(t testing.TB) {
|
||||
|
@@ -2,12 +2,13 @@ package test_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"restic"
|
||||
"restic/errors"
|
||||
"testing"
|
||||
|
||||
"restic/backend/mem"
|
||||
"restic/backend/test"
|
||||
"github.com/restic/restic/internal"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
|
||||
"github.com/restic/restic/internal/backend/mem"
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
)
|
||||
|
||||
//go:generate go run generate_test_list.go
|
||||
|
@@ -4,7 +4,8 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"restic"
|
||||
|
||||
"github.com/restic/restic/internal"
|
||||
)
|
||||
|
||||
// LoadAll reads all data stored in the backend for the handle.
|
||||
|
@@ -4,12 +4,13 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"math/rand"
|
||||
"restic"
|
||||
"testing"
|
||||
|
||||
"restic/backend"
|
||||
"restic/backend/mem"
|
||||
. "restic/test"
|
||||
"github.com/restic/restic/internal"
|
||||
|
||||
"github.com/restic/restic/internal/backend"
|
||||
"github.com/restic/restic/internal/backend/mem"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
const KiB = 1 << 10
|
||||
|
Reference in New Issue
Block a user