From eab888f018b0755d13826b8f6fc760eaa8dee52c Mon Sep 17 00:00:00 2001 From: Star <> Date: Wed, 26 Jun 2024 12:21:19 +0800 Subject: [PATCH] to apigo.cc --- go.mod | 8 ++++---- plugin.go | 6 +++--- tests/api/hello.js | 2 +- tests/api/ws.js | 2 +- tests/config.yml | 2 +- tests/go.mod | 8 ++++---- tests/jsImports_test.go | 5 +++-- tests/plugin_test.go | 2 +- tests/plugin_test.js | 10 +++++----- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 466db1b..9b6c9b5 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ -module apigo.cloud/git/apigo/service +module apigo.cc/apigo/service go 1.18 require ( - apigo.cloud/git/apigo/gojs v0.0.8 - apigo.cloud/git/apigo/plugin v1.0.1 + apigo.cc/apigo/gojs v0.0.9 + apigo.cc/apigo/plugin v1.0.2 github.com/gorilla/websocket v1.5.1 github.com/ssgo/discover v1.7.5 github.com/ssgo/httpclient v1.7.5 @@ -15,7 +15,7 @@ require ( ) require ( - apigo.cloud/git/apigo/qjs v0.0.1 // indirect + apigo.cc/apigo/qjs v0.0.3 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/gomodule/redigo v1.8.8 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect diff --git a/plugin.go b/plugin.go index 026f962..04a1a57 100644 --- a/plugin.go +++ b/plugin.go @@ -1,8 +1,8 @@ package service import ( - "apigo.cloud/git/apigo/gojs" - "apigo.cloud/git/apigo/plugin" + "apigo.cc/apigo/gojs" + "apigo.cc/apigo/plugin" "errors" "fmt" "github.com/gorilla/websocket" @@ -255,7 +255,7 @@ func preStart() { func init() { plugin.Register(plugin.Plugin{ - Id: "apigo.cloud/git/apigo/service", + Id: "apigo.cc/apigo/service", Name: "web service framework by github.com/ssgo/s", Objects: map[string]any{ "start": func() { diff --git a/tests/api/hello.js b/tests/api/hello.js index d74c4aa..c2d8095 100644 --- a/tests/api/hello.js +++ b/tests/api/hello.js @@ -1,5 +1,5 @@ // Host:localhost authLevel:1 * /hello Hello World -import service from "apigo.cloud/git/apigo/service" +import service from "apigo.cc/apigo/service" let args = service.getArgs() diff --git a/tests/api/ws.js b/tests/api/ws.js index 694d405..a04a48c 100644 --- a/tests/api/ws.js +++ b/tests/api/ws.js @@ -1,5 +1,5 @@ // Host:localhost authLevel:1 WS /ws Echo over Websocket -import service from "apigo.cloud/git/apigo/service" +import service from "apigo.cc/apigo/service" let c = service.getClient() let msg = c.readJSON() diff --git a/tests/config.yml b/tests/config.yml index 857ad3b..24a88d9 100644 --- a/tests/config.yml +++ b/tests/config.yml @@ -1,4 +1,4 @@ -apigo.cloud/git/apigo/service: +apigo.cc/apigo/service: listen: 18087 # 监听端口(|隔开多个监听)(,隔开多个选项)例如 80,http|443|443:h2|127.0.0.1:8080,h2c ssl: # SSL证书配置,key为域名,value为cert和key的文件路径 a.com: # 证书匹配的域名 diff --git a/tests/go.mod b/tests/go.mod index e9e1e42..935e749 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -3,15 +3,15 @@ module tests go 1.18 require ( - apigo.cloud/git/apigo/gojs v0.0.8 - apigo.cloud/git/apigo/plugins v1.0.5 + apigo.cc/apigo/gojs v0.0.9 + apigo.cc/apigo/plugins v1.0.6 current-plugin v0.0.0 github.com/ssgo/u v1.7.5 ) require ( - apigo.cloud/git/apigo/plugin v1.0.1 // indirect - apigo.cloud/git/apigo/qjs v0.0.1 // indirect + apigo.cc/apigo/plugin v1.0.2 // indirect + apigo.cc/apigo/qjs v0.0.3 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/gomodule/redigo v1.8.8 // indirect github.com/gorilla/websocket v1.5.1 // indirect diff --git a/tests/jsImports_test.go b/tests/jsImports_test.go index 752609b..9b67bb0 100644 --- a/tests/jsImports_test.go +++ b/tests/jsImports_test.go @@ -1,3 +1,4 @@ package service_test -import _ "apigo.cloud/git/apigo/plugins/file" -import _ "apigo.cloud/git/apigo/plugins/runtime" + +import _ "apigo.cc/apigo/plugins/file" +import _ "apigo.cc/apigo/plugins/runtime" diff --git a/tests/plugin_test.go b/tests/plugin_test.go index 95550d7..28e3f14 100644 --- a/tests/plugin_test.go +++ b/tests/plugin_test.go @@ -1,7 +1,7 @@ package service_test import ( - "apigo.cloud/git/apigo/gojs" + "apigo.cc/apigo/gojs" _ "current-plugin" "fmt" "github.com/ssgo/u" diff --git a/tests/plugin_test.js b/tests/plugin_test.js index 87adbdc..d051fdc 100644 --- a/tests/plugin_test.js +++ b/tests/plugin_test.js @@ -1,10 +1,10 @@ -import s from 'apigo.cloud/git/apigo/service' -import file from 'apigo.cloud/git/apigo/plugins/file' -import runtime from 'apigo.cloud/git/apigo/plugins/runtime' +import s from 'apigo.cc/apigo/service' +import file from 'apigo.cc/apigo/plugins/file' +import runtime from 'apigo.cc/apigo/plugins/runtime' import console from "console"; // test register api manually -file.write('api/echo.js', 'import service from "apigo.cloud/git/apigo/service"\nreturn service.getArgs().data') +file.write('api/echo.js', 'import service from "apigo.cc/apigo/service"\nreturn service.getArgs().data') s.register({ actionFile: 'api/echo.js', method: 'POST', @@ -33,7 +33,7 @@ if(c.get('/echo?data=World').statusCode !== 404) throw new Error('test echo over if(c.post('/echo', {data:'World'}).string() !== 'World') throw new Error('test echo over post failed') // test api hot load -file.write('api/echo.js', 'import service from "apigo.cloud/git/apigo/service"\nreturn service.getArgs().data+"!"') +file.write('api/echo.js', 'import service from "apigo.cc/apigo/service"\nreturn service.getArgs().data+"!"') runtime.sleep(200) if(c.post('/echo', {data:'World'}).string() !== 'World!') throw new Error('t est echo over post failed') file.remove('api/echo.js')