Skip to content

Commit

Permalink
Merge pull request #776 from trheyi/main
Browse files Browse the repository at this point in the history
Remove deprecated storage and import API definitions
  • Loading branch information
trheyi authored Nov 6, 2024
2 parents dd49ae4 + c5a5a84 commit 8632a6a
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 254 deletions.
19 changes: 0 additions & 19 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ package api

import (
"fmt"
"path/filepath"
"strings"

"github.com/yaoapp/gou/api"
"github.com/yaoapp/gou/application"
"github.com/yaoapp/yao/config"
"github.com/yaoapp/yao/data"
"github.com/yaoapp/yao/share"
)

Expand All @@ -28,23 +26,6 @@ func Load(cfg config.Config) error {
return err
}, exts...)

// Load APIs from bindata (**will be removed in the future**)
names := []string{"import", "storage"}
for _, name := range names {
file := filepath.Join("yao", "apis", fmt.Sprintf("%s.http.json", name))
id := fmt.Sprintf("xiang.%s", name)

source, err := data.Read(file)
if err != nil {
messages = append(messages, err.Error())
}

_, err = api.LoadSource(file, source, id)
if err != nil {
messages = append(messages, err.Error())
}
}

if len(messages) > 0 {
return fmt.Errorf(strings.Join(messages, ";\n"))
}
Expand Down
4 changes: 2 additions & 2 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func check(t *testing.T) {
assert.True(t, ids["user"])
assert.True(t, ids["user.pet"])

assert.True(t, ids["xiang.import"]) // will be removed in the future
assert.True(t, ids["xiang.storage"]) // will be removed in the future
// assert.True(t, ids["xiang.import"]) // will be removed in the future
// assert.True(t, ids["xiang.storage"]) // will be removed in the future

// wskeys := []string{}
// for key := range websocket.Upgraders {
Expand Down
Loading

0 comments on commit 8632a6a

Please sign in to comment.