tidy modules
update db
This commit is contained in:
parent
3781c8ca4e
commit
04e4f771fb
6
go.mod
6
go.mod
@ -6,8 +6,8 @@ require (
|
|||||||
github.com/dlclark/regexp2 v1.11.4
|
github.com/dlclark/regexp2 v1.11.4
|
||||||
github.com/go-sourcemap/sourcemap v2.1.4+incompatible
|
github.com/go-sourcemap/sourcemap v2.1.4+incompatible
|
||||||
github.com/google/pprof v0.0.0-20230207041349-798e818bf904
|
github.com/google/pprof v0.0.0-20230207041349-798e818bf904
|
||||||
github.com/ssgo/dao v0.1.4
|
github.com/ssgo/dao v0.1.5
|
||||||
github.com/ssgo/db v1.7.8
|
github.com/ssgo/db v1.7.9
|
||||||
github.com/ssgo/httpclient v1.7.7
|
github.com/ssgo/httpclient v1.7.7
|
||||||
github.com/ssgo/log v1.7.7
|
github.com/ssgo/log v1.7.7
|
||||||
github.com/ssgo/tool v0.4.27
|
github.com/ssgo/tool v0.4.27
|
||||||
@ -21,7 +21,7 @@ require (
|
|||||||
filippo.io/edwards25519 v1.1.0 // indirect
|
filippo.io/edwards25519 v1.1.0 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/go-sql-driver/mysql v1.8.1 // 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/config v1.7.7 // indirect
|
||||||
github.com/ssgo/standard v1.7.7 // indirect
|
github.com/ssgo/standard v1.7.7 // indirect
|
||||||
golang.org/x/sys v0.25.0 // indirect
|
golang.org/x/sys v0.25.0 // indirect
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package js
|
package console
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"apigo.cc/apigo/gojs"
|
"apigo.cc/apigo/gojs"
|
||||||
@ -13,7 +13,7 @@ import (
|
|||||||
//go:embed console.ts
|
//go:embed console.ts
|
||||||
var consoleTS string
|
var consoleTS string
|
||||||
|
|
||||||
func RegisterConsoleModel() {
|
func init() {
|
||||||
obj := map[string]any{
|
obj := map[string]any{
|
||||||
"print": func(args goja.FunctionCall) goja.Value {
|
"print": func(args goja.FunctionCall) goja.Value {
|
||||||
consolePrint(args, "print", nil)
|
consolePrint(args, "print", nil)
|
@ -1,4 +1,4 @@
|
|||||||
package js
|
package db
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"apigo.cc/apigo/gojs"
|
"apigo.cc/apigo/gojs"
|
||||||
@ -16,7 +16,7 @@ var dbTS string
|
|||||||
//go:embed db.md
|
//go:embed db.md
|
||||||
var dbMD string
|
var dbMD string
|
||||||
|
|
||||||
func RegisterDBModel() {
|
func init() {
|
||||||
obj := map[string]any{
|
obj := map[string]any{
|
||||||
"get": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
"get": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
||||||
args := gojs.MakeArgs(&argsIn, vm).Check(1)
|
args := gojs.MakeArgs(&argsIn, vm).Check(1)
|
@ -1,4 +1,4 @@
|
|||||||
package js
|
package file
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"apigo.cc/apigo/gojs"
|
"apigo.cc/apigo/gojs"
|
||||||
@ -11,7 +11,7 @@ import (
|
|||||||
//go:embed file.ts
|
//go:embed file.ts
|
||||||
var fileTS string
|
var fileTS string
|
||||||
|
|
||||||
func RegisterFileModel() {
|
func init() {
|
||||||
obj := map[string]any{
|
obj := map[string]any{
|
||||||
"read": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
"read": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
||||||
args := gojs.MakeArgs(&argsIn, vm).Check(1)
|
args := gojs.MakeArgs(&argsIn, vm).Check(1)
|
@ -1,4 +1,4 @@
|
|||||||
package js
|
package http
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"apigo.cc/apigo/gojs"
|
"apigo.cc/apigo/gojs"
|
||||||
@ -23,7 +23,7 @@ var h2cHttp = &Http{
|
|||||||
client: httpclient.GetClientH2C(0),
|
client: httpclient.GetClientH2C(0),
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterHTTPModel() {
|
func init() {
|
||||||
obj := map[string]any{
|
obj := map[string]any{
|
||||||
"get": defaultHttp.Get,
|
"get": defaultHttp.Get,
|
||||||
"get2C": h2cHttp.Get,
|
"get2C": h2cHttp.Get,
|
@ -1,4 +1,4 @@
|
|||||||
package js
|
package log
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"apigo.cc/apigo/gojs"
|
"apigo.cc/apigo/gojs"
|
||||||
@ -12,7 +12,7 @@ var logTS string
|
|||||||
//go:embed log.md
|
//go:embed log.md
|
||||||
var logMD string
|
var logMD string
|
||||||
|
|
||||||
func RegisterLogModel() {
|
func init() {
|
||||||
obj := map[string]any{
|
obj := map[string]any{
|
||||||
"info": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
"info": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
||||||
args := gojs.MakeArgs(&argsIn, vm).Check(1)
|
args := gojs.MakeArgs(&argsIn, vm).Check(1)
|
@ -1,10 +1,10 @@
|
|||||||
package js
|
package modules
|
||||||
|
|
||||||
func init() {
|
import (
|
||||||
RegisterConsoleModel()
|
_ "apigo.cc/apigo/gojs/modules/console"
|
||||||
RegisterDBModel()
|
_ "apigo.cc/apigo/gojs/modules/db"
|
||||||
RegisterFileModel()
|
_ "apigo.cc/apigo/gojs/modules/file"
|
||||||
RegisterHTTPModel()
|
_ "apigo.cc/apigo/gojs/modules/http"
|
||||||
RegisterLogModel()
|
_ "apigo.cc/apigo/gojs/modules/log"
|
||||||
RegisterUtilModel()
|
_ "apigo.cc/apigo/gojs/modules/util"
|
||||||
}
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package js
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"apigo.cc/apigo/gojs"
|
"apigo.cc/apigo/gojs"
|
||||||
@ -17,7 +17,7 @@ import (
|
|||||||
//go:embed util.ts
|
//go:embed util.ts
|
||||||
var utilTS string
|
var utilTS string
|
||||||
|
|
||||||
func RegisterUtilModel() {
|
func init() {
|
||||||
obj := map[string]any{
|
obj := map[string]any{
|
||||||
"json": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
"json": func(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
||||||
args := gojs.MakeArgs(&argsIn, vm).Check(1)
|
args := gojs.MakeArgs(&argsIn, vm).Check(1)
|
Loading…
Reference in New Issue
Block a user