mirror of
https://2025-dev.shylinux.com/x/20250211-service
synced 2025-04-25 04:38:06 +08:00
38 lines
970 B
Go
38 lines
970 B
Go
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{}) }
|