mirror of
https://2025-dev.shylinux.com/x/20250211-service
synced 2025-04-25 04:38:06 +08:00
add some
This commit is contained in:
parent
cec7cdeefd
commit
85b69a82a5
37
src/gateway/gateway.go
Normal file
37
src/gateway/gateway.go
Normal 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{}) }
|
@ -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()) }
|
||||
|
@ -1,4 +1,4 @@
|
||||
title "ContextOS 开发平台"
|
||||
title "ContextOS-Service"
|
||||
refer `
|
||||
网址 https://dev.shylinux.com
|
||||
`
|
Loading…
x
Reference in New Issue
Block a user