Skip to content

Commit

Permalink
feat: Add operations back to Storager (#967)
Browse files Browse the repository at this point in the history
* feat: Add operations back to Storager

* Fix breaking changes
  • Loading branch information
JinnyYi authored Oct 27, 2021
1 parent e68a82c commit 2fc3ded
Show file tree
Hide file tree
Showing 16 changed files with 1,831 additions and 295 deletions.
4 changes: 3 additions & 1 deletion cmd/definitions/gen_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ func generateOperation(data *Data, path string) {
inter.NewFunction("mustEmbedUnimplemented" + in.DisplayName())

stubName := "Unimplemented" + in.DisplayName()
f.AddLineComment("%s must be embedded to have forward compatible implementations.", stubName)
f.AddLineComment("%s must be embedded to have forward compatible implementations.", stubName).
AddLineComment("").
AddLineComment("%s %s", in.DisplayName(), in.Description)
f.NewStruct(stubName)

f.NewFunction("mustEmbedUnimplemented"+in.DisplayName()).
Expand Down
9 changes: 4 additions & 5 deletions cmd/definitions/gen_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ GetStorageSystemMetadata will get StorageSystemMetadata from Storage.

// Generate interface assert.
inters := f.NewVar()
for _, inter := range ns.ParsedInterfaces() {
interNameP := templateutils.ToPascal(inter.Name)
inters.AddTypedField(
"_", interNameP, gg.S("&%s{}", nsNameP))
}
inter := ns.ParsedInterface()
interNameP := templateutils.ToPascal(inter.Name)
inters.AddTypedField(
"_", interNameP, gg.S("&%s{}", nsNameP))

// Generate feature struct.
features := f.NewStruct(nsNameP + "Features")
Expand Down
Loading

0 comments on commit 2fc3ded

Please sign in to comment.