tidy modules

update db
This commit is contained in:
Star 2024-10-02 14:05:52 +08:00
parent 3781c8ca4e
commit 04e4f771fb
16 changed files with 24 additions and 24 deletions

6
go.mod
View File

@ -6,8 +6,8 @@ require (
github.com/dlclark/regexp2 v1.11.4
github.com/go-sourcemap/sourcemap v2.1.4+incompatible
github.com/google/pprof v0.0.0-20230207041349-798e818bf904
github.com/ssgo/dao v0.1.4
github.com/ssgo/db v1.7.8
github.com/ssgo/dao v0.1.5
github.com/ssgo/db v1.7.9
github.com/ssgo/httpclient v1.7.7
github.com/ssgo/log v1.7.7
github.com/ssgo/tool v0.4.27
@ -21,7 +21,7 @@ require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/ssgo/config v1.7.7 // indirect
github.com/ssgo/standard v1.7.7 // indirect
golang.org/x/sys v0.25.0 // indirect

View File

@ -1,4 +1,4 @@
package js
package console
import (
"apigo.cc/apigo/gojs"
@ -13,7 +13,7 @@ import (
//go:embed console.ts
var consoleTS string
func RegisterConsoleModel() {
func init() {
obj := map[string]any{
"print": func(args goja.FunctionCall) goja.Value {
consolePrint(args, "print", nil)

View File

@ -1,4 +1,4 @@
package js
package db
import (
"apigo.cc/apigo/gojs"
@ -16,7 +16,7 @@ var dbTS string
//go:embed db.md
var dbMD string
func RegisterDBModel() {
func init() {
obj := map[string]any{
"get": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
args := gojs.MakeArgs(&argsIn, vm).Check(1)

View File

@ -1,4 +1,4 @@
package js
package file
import (
"apigo.cc/apigo/gojs"
@ -11,7 +11,7 @@ import (
//go:embed file.ts
var fileTS string
func RegisterFileModel() {
func init() {
obj := map[string]any{
"read": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
args := gojs.MakeArgs(&argsIn, vm).Check(1)

View File

@ -1,4 +1,4 @@
package js
package http
import (
"apigo.cc/apigo/gojs"
@ -23,7 +23,7 @@ var h2cHttp = &Http{
client: httpclient.GetClientH2C(0),
}
func RegisterHTTPModel() {
func init() {
obj := map[string]any{
"get": defaultHttp.Get,
"get2C": h2cHttp.Get,

View File

@ -1,4 +1,4 @@
package js
package log
import (
"apigo.cc/apigo/gojs"
@ -12,7 +12,7 @@ var logTS string
//go:embed log.md
var logMD string
func RegisterLogModel() {
func init() {
obj := map[string]any{
"info": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
args := gojs.MakeArgs(&argsIn, vm).Check(1)

View File

@ -1,10 +1,10 @@
package js
package modules
func init() {
RegisterConsoleModel()
RegisterDBModel()
RegisterFileModel()
RegisterHTTPModel()
RegisterLogModel()
RegisterUtilModel()
}
import (
_ "apigo.cc/apigo/gojs/modules/console"
_ "apigo.cc/apigo/gojs/modules/db"
_ "apigo.cc/apigo/gojs/modules/file"
_ "apigo.cc/apigo/gojs/modules/http"
_ "apigo.cc/apigo/gojs/modules/log"
_ "apigo.cc/apigo/gojs/modules/util"
)

View File

@ -1,4 +1,4 @@
package js
package util
import (
"apigo.cc/apigo/gojs"
@ -17,7 +17,7 @@ import (
//go:embed util.ts
var utilTS string
func RegisterUtilModel() {
func init() {
obj := map[string]any{
"json": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
args := gojs.MakeArgs(&argsIn, vm).Check(1)