mirror of
https://github.com/octoleo/restic.git
synced 2025-01-01 14:31:51 +00:00
backend: fix linter warnings
This commit is contained in:
parent
a27b7f1370
commit
25a0be7f26
internal/backend
azure
b2
gs
rclone
s3
sftp
swift
@ -7,17 +7,17 @@ import (
|
||||
)
|
||||
|
||||
var configTests = []test.ConfigTestData[Config]{
|
||||
{"azure:container-name:/", Config{
|
||||
{S: "azure:container-name:/", Cfg: Config{
|
||||
Container: "container-name",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"azure:container-name:/prefix/directory", Config{
|
||||
{S: "azure:container-name:/prefix/directory", Cfg: Config{
|
||||
Container: "container-name",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"azure:container-name:/prefix/directory/", Config{
|
||||
{S: "azure:container-name:/prefix/directory/", Cfg: Config{
|
||||
Container: "container-name",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
|
@ -7,32 +7,32 @@ import (
|
||||
)
|
||||
|
||||
var configTests = []test.ConfigTestData[Config]{
|
||||
{"b2:bucketname", Config{
|
||||
{S: "b2:bucketname", Cfg: Config{
|
||||
Bucket: "bucketname",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"b2:bucketname:", Config{
|
||||
{S: "b2:bucketname:", Cfg: Config{
|
||||
Bucket: "bucketname",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"b2:bucketname:/prefix/directory", Config{
|
||||
{S: "b2:bucketname:/prefix/directory", Cfg: Config{
|
||||
Bucket: "bucketname",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"b2:foobar", Config{
|
||||
{S: "b2:foobar", Cfg: Config{
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"b2:foobar:", Config{
|
||||
{S: "b2:foobar:", Cfg: Config{
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"b2:foobar:/", Config{
|
||||
{S: "b2:foobar:/", Cfg: Config{
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
|
@ -7,19 +7,19 @@ import (
|
||||
)
|
||||
|
||||
var configTests = []test.ConfigTestData[Config]{
|
||||
{"gs:bucketname:/", Config{
|
||||
{S: "gs:bucketname:/", Cfg: Config{
|
||||
Bucket: "bucketname",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
Region: "us",
|
||||
}},
|
||||
{"gs:bucketname:/prefix/directory", Config{
|
||||
{S: "gs:bucketname:/prefix/directory", Cfg: Config{
|
||||
Bucket: "bucketname",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
Region: "us",
|
||||
}},
|
||||
{"gs:bucketname:/prefix/directory/", Config{
|
||||
{S: "gs:bucketname:/prefix/directory/", Cfg: Config{
|
||||
Bucket: "bucketname",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
|
@ -8,8 +8,8 @@ import (
|
||||
|
||||
var configTests = []test.ConfigTestData[Config]{
|
||||
{
|
||||
"rclone:local:foo:/bar",
|
||||
Config{
|
||||
S: "rclone:local:foo:/bar",
|
||||
Cfg: Config{
|
||||
Remote: "local:foo:/bar",
|
||||
Program: defaultConfig.Program,
|
||||
Args: defaultConfig.Args,
|
||||
|
@ -8,88 +8,88 @@ import (
|
||||
)
|
||||
|
||||
var configTests = []test.ConfigTestData[Config]{
|
||||
{"s3://eu-central-1/bucketname", Config{
|
||||
{S: "s3://eu-central-1/bucketname", Cfg: Config{
|
||||
Endpoint: "eu-central-1",
|
||||
Bucket: "bucketname",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3://eu-central-1/bucketname/", Config{
|
||||
{S: "s3://eu-central-1/bucketname/", Cfg: Config{
|
||||
Endpoint: "eu-central-1",
|
||||
Bucket: "bucketname",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3://eu-central-1/bucketname/prefix/directory", Config{
|
||||
{S: "s3://eu-central-1/bucketname/prefix/directory", Cfg: Config{
|
||||
Endpoint: "eu-central-1",
|
||||
Bucket: "bucketname",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3://eu-central-1/bucketname/prefix/directory/", Config{
|
||||
{S: "s3://eu-central-1/bucketname/prefix/directory/", Cfg: Config{
|
||||
Endpoint: "eu-central-1",
|
||||
Bucket: "bucketname",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:eu-central-1/foobar", Config{
|
||||
{S: "s3:eu-central-1/foobar", Cfg: Config{
|
||||
Endpoint: "eu-central-1",
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:eu-central-1/foobar/", Config{
|
||||
{S: "s3:eu-central-1/foobar/", Cfg: Config{
|
||||
Endpoint: "eu-central-1",
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:eu-central-1/foobar/prefix/directory", Config{
|
||||
{S: "s3:eu-central-1/foobar/prefix/directory", Cfg: Config{
|
||||
Endpoint: "eu-central-1",
|
||||
Bucket: "foobar",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:eu-central-1/foobar/prefix/directory/", Config{
|
||||
{S: "s3:eu-central-1/foobar/prefix/directory/", Cfg: Config{
|
||||
Endpoint: "eu-central-1",
|
||||
Bucket: "foobar",
|
||||
Prefix: "prefix/directory",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:https://hostname:9999/foobar", Config{
|
||||
{S: "s3:https://hostname:9999/foobar", Cfg: Config{
|
||||
Endpoint: "hostname:9999",
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:https://hostname:9999/foobar/", Config{
|
||||
{S: "s3:https://hostname:9999/foobar/", Cfg: Config{
|
||||
Endpoint: "hostname:9999",
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:http://hostname:9999/foobar", Config{
|
||||
{S: "s3:http://hostname:9999/foobar", Cfg: Config{
|
||||
Endpoint: "hostname:9999",
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
UseHTTP: true,
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:http://hostname:9999/foobar/", Config{
|
||||
{S: "s3:http://hostname:9999/foobar/", Cfg: Config{
|
||||
Endpoint: "hostname:9999",
|
||||
Bucket: "foobar",
|
||||
Prefix: "",
|
||||
UseHTTP: true,
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:http://hostname:9999/bucket/prefix/directory", Config{
|
||||
{S: "s3:http://hostname:9999/bucket/prefix/directory", Cfg: Config{
|
||||
Endpoint: "hostname:9999",
|
||||
Bucket: "bucket",
|
||||
Prefix: "prefix/directory",
|
||||
UseHTTP: true,
|
||||
Connections: 5,
|
||||
}},
|
||||
{"s3:http://hostname:9999/bucket/prefix/directory/", Config{
|
||||
{S: "s3:http://hostname:9999/bucket/prefix/directory/", Cfg: Config{
|
||||
Endpoint: "hostname:9999",
|
||||
Bucket: "bucket",
|
||||
Prefix: "prefix/directory",
|
||||
|
@ -9,69 +9,69 @@ import (
|
||||
var configTests = []test.ConfigTestData[Config]{
|
||||
// first form, user specified sftp://user@host/dir
|
||||
{
|
||||
"sftp://user@host/dir/subdir",
|
||||
Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||
S: "sftp://user@host/dir/subdir",
|
||||
Cfg: Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp://host/dir/subdir",
|
||||
Config{Host: "host", Path: "dir/subdir", Connections: 5},
|
||||
S: "sftp://host/dir/subdir",
|
||||
Cfg: Config{Host: "host", Path: "dir/subdir", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp://host//dir/subdir",
|
||||
Config{Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||
S: "sftp://host//dir/subdir",
|
||||
Cfg: Config{Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp://host:10022//dir/subdir",
|
||||
Config{Host: "host", Port: "10022", Path: "/dir/subdir", Connections: 5},
|
||||
S: "sftp://host:10022//dir/subdir",
|
||||
Cfg: Config{Host: "host", Port: "10022", Path: "/dir/subdir", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp://user@host:10022//dir/subdir",
|
||||
Config{User: "user", Host: "host", Port: "10022", Path: "/dir/subdir", Connections: 5},
|
||||
S: "sftp://user@host:10022//dir/subdir",
|
||||
Cfg: Config{User: "user", Host: "host", Port: "10022", Path: "/dir/subdir", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp://user@host/dir/subdir/../other",
|
||||
Config{User: "user", Host: "host", Path: "dir/other", Connections: 5},
|
||||
S: "sftp://user@host/dir/subdir/../other",
|
||||
Cfg: Config{User: "user", Host: "host", Path: "dir/other", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp://user@host/dir///subdir",
|
||||
Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||
S: "sftp://user@host/dir///subdir",
|
||||
Cfg: Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||
},
|
||||
|
||||
// IPv6 address.
|
||||
{
|
||||
"sftp://user@[::1]/dir",
|
||||
Config{User: "user", Host: "::1", Path: "dir", Connections: 5},
|
||||
S: "sftp://user@[::1]/dir",
|
||||
Cfg: Config{User: "user", Host: "::1", Path: "dir", Connections: 5},
|
||||
},
|
||||
// IPv6 address with port.
|
||||
{
|
||||
"sftp://user@[::1]:22/dir",
|
||||
Config{User: "user", Host: "::1", Port: "22", Path: "dir", Connections: 5},
|
||||
S: "sftp://user@[::1]:22/dir",
|
||||
Cfg: Config{User: "user", Host: "::1", Port: "22", Path: "dir", Connections: 5},
|
||||
},
|
||||
|
||||
// second form, user specified sftp:user@host:/dir
|
||||
{
|
||||
"sftp:user@host:/dir/subdir",
|
||||
Config{User: "user", Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||
S: "sftp:user@host:/dir/subdir",
|
||||
Cfg: Config{User: "user", Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp:user@domain@host:/dir/subdir",
|
||||
Config{User: "user@domain", Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||
S: "sftp:user@domain@host:/dir/subdir",
|
||||
Cfg: Config{User: "user@domain", Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp:host:../dir/subdir",
|
||||
Config{Host: "host", Path: "../dir/subdir", Connections: 5},
|
||||
S: "sftp:host:../dir/subdir",
|
||||
Cfg: Config{Host: "host", Path: "../dir/subdir", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp:user@host:dir/subdir:suffix",
|
||||
Config{User: "user", Host: "host", Path: "dir/subdir:suffix", Connections: 5},
|
||||
S: "sftp:user@host:dir/subdir:suffix",
|
||||
Cfg: Config{User: "user", Host: "host", Path: "dir/subdir:suffix", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp:user@host:dir/subdir/../other",
|
||||
Config{User: "user", Host: "host", Path: "dir/other", Connections: 5},
|
||||
S: "sftp:user@host:dir/subdir/../other",
|
||||
Cfg: Config{User: "user", Host: "host", Path: "dir/other", Connections: 5},
|
||||
},
|
||||
{
|
||||
"sftp:user@host:dir///subdir",
|
||||
Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||
S: "sftp:user@host:dir///subdir",
|
||||
Cfg: Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -8,23 +8,23 @@ import (
|
||||
|
||||
var configTests = []test.ConfigTestData[Config]{
|
||||
{
|
||||
"swift:cnt1:/",
|
||||
Config{
|
||||
S: "swift:cnt1:/",
|
||||
Cfg: Config{
|
||||
Container: "cnt1",
|
||||
Prefix: "",
|
||||
Connections: 5,
|
||||
},
|
||||
},
|
||||
{
|
||||
"swift:cnt2:/prefix",
|
||||
Config{Container: "cnt2",
|
||||
S: "swift:cnt2:/prefix",
|
||||
Cfg: Config{Container: "cnt2",
|
||||
Prefix: "prefix",
|
||||
Connections: 5,
|
||||
},
|
||||
},
|
||||
{
|
||||
"swift:cnt3:/prefix/longer",
|
||||
Config{Container: "cnt3",
|
||||
S: "swift:cnt3:/prefix/longer",
|
||||
Cfg: Config{Container: "cnt3",
|
||||
Prefix: "prefix/longer",
|
||||
Connections: 5,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user