Skip to content

Commit 202e446

Browse files
author
neo.chen
committed
feat(fs): add fs servicer
1 parent 8dc523c commit 202e446

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+697
-508
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
99

1010
## [v5.0.0] - 2021-10-15
1111

12-
Since this release, we will use `go.beyondstorage.io/v5` as new module name.
12+
Since this release, we will use `github.com/fastone-open/go-storage` as new module name.
1313

1414
### Added
1515

cmd/definitions/gen_pair.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ func generatePair(data *Data, path string) {
1919
AddPath("context").
2020
AddPath("time").
2121
AddLine().
22-
AddPath("go.beyondstorage.io/v5/pkg/httpclient").
23-
AddDot("go.beyondstorage.io/v5/types")
22+
AddPath("github.com/fastone-open/go-storage/pkg/httpclient").
23+
AddDot("github.com/fastone-open/go-storage/types")
2424

2525
ps := make([]*Pair, 0, len(data.PairsMap))
2626
for _, v := range data.PairsMap {

cmd/definitions/gen_service.go

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package main
55

66
import (
77
"fmt"
8+
89
"github.com/Xuanwo/gg"
910
"github.com/Xuanwo/templateutils"
1011
log "github.com/sirupsen/logrus"
@@ -21,10 +22,10 @@ func generateSrv(data *Service, path string) {
2122
AddPath("strings").
2223
AddPath("time").
2324
AddLine().
24-
AddDot("go.beyondstorage.io/v5/pairs").
25-
AddPath("go.beyondstorage.io/v5/pkg/httpclient").
26-
AddPath("go.beyondstorage.io/v5/services").
27-
AddDot("go.beyondstorage.io/v5/types")
25+
AddDot("github.com/fastone-open/go-storage/pairs").
26+
AddPath("github.com/fastone-open/go-storage/pkg/httpclient").
27+
AddPath("github.com/fastone-open/go-storage/services").
28+
AddDot("github.com/fastone-open/go-storage/types")
2829

2930
f.NewVar().
3031
AddDecl("_", "Storager").
@@ -179,12 +180,12 @@ GetStorageSystemMetadata will get StorageSystemMetadata from Storage.
179180
"_", interNameP, gg.S("&%s{}", nsNameP))
180181
}
181182

182-
// Generate feature struct.
183-
features := f.NewStruct(nsNameP + "Features")
184-
for _, fs := range ns.ParsedFeatures() {
185-
features.AddLineComment(fs.Description)
186-
features.AddField(templateutils.ToPascal(fs.Name), "bool")
187-
}
183+
// // Generate feature struct.
184+
// features := f.NewStruct(nsNameP + "Features")
185+
// for _, fs := range ns.ParsedFeatures() {
186+
// features.AddLineComment(fs.Description)
187+
// features.AddField(templateutils.ToPascal(fs.Name), "bool")
188+
// }
188189

189190
// Generate pair new.
190191
fnNewNameP := templateutils.ToPascal(ns.New.Name)
@@ -315,13 +316,13 @@ GetStorageSystemMetadata will get StorageSystemMetadata from Storage.
315316
gg.Return("result", "nil"),
316317
)
317318

318-
// Generate default pairs.
319-
f.AddLineComment("Default%sPairs is default pairs for specific action", nsNameP)
320-
dps := f.NewStruct(fmt.Sprintf("Default%sPairs", nsNameP))
321-
for _, fn := range ns.ParsedFunctions() {
322-
fnNameP := templateutils.ToPascal(fn.Name)
323-
dps.AddField(fnNameP, "[]Pair")
324-
}
319+
// // Generate default pairs.
320+
// f.AddLineComment("Default%sPairs is default pairs for specific action", nsNameP)
321+
// dps := f.NewStruct(fmt.Sprintf("Default%sPairs", nsNameP))
322+
// for _, fn := range ns.ParsedFunctions() {
323+
// fnNameP := templateutils.ToPascal(fn.Name)
324+
// dps.AddField(fnNameP, "[]Pair")
325+
// }
325326

326327
// Generate pair.
327328
for _, fn := range ns.ParsedFunctions() {

cmd/definitions/testdata/service.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "tests"
22

33
[namespace.service.new]
44
required = ["credential"]
5-
optional = ["service_features", "default_service_pairs", "endpoint", "http_client_options"]
5+
optional = ["endpoint", "http_client_options"]
66

77
[namespace.service.op.create]
88
required = ["location"]
@@ -22,7 +22,7 @@ implement = ["copier", "fetcher", "mover", "multiparter", "reacher", "appender"]
2222

2323
[namespace.storage.new]
2424
required = ["name"]
25-
optional = ["storage_features", "default_storage_pairs", "disable_uri_cleaning", "http_client_options", "location", "work_dir"]
25+
optional = ["disable_uri_cleaning", "http_client_options", "location", "work_dir"]
2626

2727
[namespace.storage.op.delete]
2828
optional = ["multipart_id", "object_mode"]

cmd/definitions/tests/connstr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestFromString(t *testing.T) {
118118
[]Pair{
119119
pairs.WithName("abc"),
120120
pairs.WithWorkDir("/tmp"),
121-
WithEnableLoosePair(),
121+
pairs.WithEnableLoosePair(),
122122
},
123123
nil,
124124
},

0 commit comments

Comments
 (0)