This commit is contained in:
root 2025-02-18 11:18:34 +08:00
parent cec7cdeefd
commit 85b69a82a5
3 changed files with 43 additions and 3 deletions

37
src/gateway/gateway.go Normal file
View File

@ -0,0 +1,37 @@
package gateway
import (
"runtime"
"shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/cli"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/tcp"
"shylinux.com/x/icebergs/base/web"
"shylinux.com/x/icebergs/core/code"
kit "shylinux.com/x/toolkits"
"2025-dev.shylinux.com/x/20250215-cluster/src/travel"
)
type gateway struct {
travel.Travel
list string `name:"list space auto" help:"应用网关"`
}
func (s gateway) List(m *ice.Message, arg ...string) {
if len(arg) == 0 {
m.Push(cli.GOOS, runtime.GOOS)
m.Push(cli.GOARCH, runtime.GOARCH)
m.Push(nfs.VERSION, ice.Info.Make.Version)
m.Push(mdb.TIME, ice.Info.Make.Time)
m.Action(s.Foreach)
m.Option(cli.CTX_ARG, kit.JoinCmdArgs(tcp.NODENAME, m.Option(ice.MSG_USERPOD)))
m.Cmdy(code.PUBLISH, nfs.CONTEXTS, ice.APP)
} else {
m.Cmdy(web.SPACE, arg[0], m.PrefixKey())
}
}
func init() { ice.Cmd("web.chat.dev.service.gateway", gateway{}) }

View File

@ -1,5 +1,8 @@
package main
import "shylinux.com/x/ice"
import (
_ "2025-dev.shylinux.com/x/20250211-service/src/gateway"
"shylinux.com/x/ice"
)
func main() { print(ice.Run()) }
func main() { print(ice.Run()) }

View File

@ -1,4 +1,4 @@
title "ContextOS 开发平台"
title "ContextOS-Service"
refer `
网址 https://dev.shylinux.com
`