move Backend interface to backend package
This commit is contained in:
parent
ceb0774af1
commit
1b8a67fe76
105 changed files with 822 additions and 775 deletions
|
@ -10,8 +10,8 @@ import (
|
|||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic/internal/backend"
|
||||
"github.com/restic/restic/internal/backend/rest"
|
||||
"github.com/restic/restic/internal/restic"
|
||||
)
|
||||
|
||||
func TestListAPI(t *testing.T) {
|
||||
|
@ -22,7 +22,7 @@ func TestListAPI(t *testing.T) {
|
|||
Data string // response data
|
||||
Requests int
|
||||
|
||||
Result []restic.FileInfo
|
||||
Result []backend.FileInfo
|
||||
}{
|
||||
{
|
||||
Name: "content-type-unknown",
|
||||
|
@ -32,7 +32,7 @@ func TestListAPI(t *testing.T) {
|
|||
"3b6ec1af8d4f7099d0445b12fdb75b166ba19f789e5c48350c423dc3b3e68352",
|
||||
"8271d221a60e0058e6c624f248d0080fc04f4fac07a28584a9b89d0eb69e189b"
|
||||
]`,
|
||||
Result: []restic.FileInfo{
|
||||
Result: []backend.FileInfo{
|
||||
{Name: "1122e6749358b057fa1ac6b580a0fbe7a9a5fbc92e82743ee21aaf829624a985", Size: 4386},
|
||||
{Name: "3b6ec1af8d4f7099d0445b12fdb75b166ba19f789e5c48350c423dc3b3e68352", Size: 15214},
|
||||
{Name: "8271d221a60e0058e6c624f248d0080fc04f4fac07a28584a9b89d0eb69e189b", Size: 33393},
|
||||
|
@ -47,7 +47,7 @@ func TestListAPI(t *testing.T) {
|
|||
"3b6ec1af8d4f7099d0445b12fdb75b166ba19f789e5c48350c423dc3b3e68352",
|
||||
"8271d221a60e0058e6c624f248d0080fc04f4fac07a28584a9b89d0eb69e189b"
|
||||
]`,
|
||||
Result: []restic.FileInfo{
|
||||
Result: []backend.FileInfo{
|
||||
{Name: "1122e6749358b057fa1ac6b580a0fbe7a9a5fbc92e82743ee21aaf829624a985", Size: 4386},
|
||||
{Name: "3b6ec1af8d4f7099d0445b12fdb75b166ba19f789e5c48350c423dc3b3e68352", Size: 15214},
|
||||
{Name: "8271d221a60e0058e6c624f248d0080fc04f4fac07a28584a9b89d0eb69e189b", Size: 33393},
|
||||
|
@ -62,7 +62,7 @@ func TestListAPI(t *testing.T) {
|
|||
{"name": "3b6ec1af8d4f7099d0445b12fdb75b166ba19f789e5c48350c423dc3b3e68352", "size": 1002},
|
||||
{"name": "8271d221a60e0058e6c624f248d0080fc04f4fac07a28584a9b89d0eb69e189b", "size": 1003}
|
||||
]`,
|
||||
Result: []restic.FileInfo{
|
||||
Result: []backend.FileInfo{
|
||||
{Name: "1122e6749358b057fa1ac6b580a0fbe7a9a5fbc92e82743ee21aaf829624a985", Size: 1001},
|
||||
{Name: "3b6ec1af8d4f7099d0445b12fdb75b166ba19f789e5c48350c423dc3b3e68352", Size: 1002},
|
||||
{Name: "8271d221a60e0058e6c624f248d0080fc04f4fac07a28584a9b89d0eb69e189b", Size: 1003},
|
||||
|
@ -122,8 +122,8 @@ func TestListAPI(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
var list []restic.FileInfo
|
||||
err = be.List(context.TODO(), restic.PackFile, func(fi restic.FileInfo) error {
|
||||
var list []backend.FileInfo
|
||||
err = be.List(context.TODO(), backend.PackFile, func(fi backend.FileInfo) error {
|
||||
list = append(list, fi)
|
||||
return nil
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue