1
0
forked from x/icebergs

opt merge

This commit is contained in:
shaoying 2020-10-29 17:08:47 +08:00
parent d6ac0ba5f0
commit d83e0dfdb5
91 changed files with 156 additions and 116 deletions

View File

@ -142,5 +142,5 @@ func init() {
m.PushAction(mdb.REMOVE)
}},
},
}, nil)
})
}

View File

@ -91,5 +91,5 @@ func init() {
m.PushAction(mdb.REMOVE)
}},
},
}, nil)
})
}

View File

@ -104,5 +104,5 @@ func init() {
})
}},
},
}, nil)
})
}

View File

@ -126,5 +126,5 @@ func init() {
m.PushAction(mdb.REMOVE)
}},
},
}, nil)
})
}

View File

@ -2,6 +2,7 @@ package cli
import (
ice "github.com/shylinux/icebergs"
"github.com/shylinux/icebergs/base/mdb"
kit "github.com/shylinux/toolkits"
"os"
@ -77,6 +78,15 @@ var Index = &ice.Context{Name: "cli", Help: "命令模块",
m.Conf(RUNTIME, "build.username", ice.Info.Build.UserName)
}},
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
list := []string{}
m.Richs(DAEMON, "", kit.MDB_FOREACH, func(key string, value map[string]interface{}) {
if value = kit.GetMeta(value); kit.Value(value, mdb.CACHE_CLEAR_ON_EXIT) == "true" {
list = append(list, key)
}
})
for _, k := range list {
m.Conf(DAEMON, kit.Keys(kit.MDB_HASH, k), "")
}
m.Save()
}},
},

View File

@ -34,6 +34,7 @@ func _daemon_show(m *ice.Message, cmd *exec.Cmd, out, err string) {
}
h := m.Cmdx(mdb.INSERT, DAEMON, "", mdb.HASH,
mdb.CACHE_CLEAR_ON_EXIT, m.Option(mdb.CACHE_CLEAR_ON_EXIT),
kit.MDB_STATUS, Status.Start, kit.SSH_CMD, strings.Join(cmd.Args, " "),
kit.SSH_DIR, cmd.Dir, kit.SSH_ENV, kit.Select("", cmd.Env), kit.SSH_PID, cmd.Process.Pid,
CMD_STDOUT, out, CMD_STDERR, err,
@ -139,5 +140,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -40,7 +40,7 @@ func Follow(m *ice.Message, action string) bool {
})
if len(m.Resultv()) == 0 && m.Conf(OUTPUT, kit.Keys(kit.MDB_HASH, m.Option(mdb.CACHE_HASH), kit.MDB_META, kit.MDB_STATUS)) == STOP {
m.Echo(STOP)
m.Option(mdb.CACHE_STATUS, STOP)
}
return true
}
@ -119,5 +119,5 @@ func init() {
m.Sort(kit.MDB_ID)
}},
},
}, nil)
})
}

View File

@ -32,5 +32,5 @@ func init() {
})
}},
},
}, nil)
})
}

View File

@ -44,5 +44,5 @@ func init() {
m.Cmdy("web.code.install", path.Base(m.Conf(PYTHON, kit.META_SOURCE)), arg)
}},
},
}, nil)
})
}

View File

@ -69,5 +69,5 @@ func init() {
m.Cmdy(ctx.CONFIG, RUNTIME, arg)
}},
},
}, nil)
})
}

View File

@ -106,5 +106,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -49,5 +49,5 @@ func init() {
_command_list(m, strings.Join(arg, "."))
}},
},
}, nil)
})
}

View File

@ -122,5 +122,5 @@ func init() {
_config_make(m, arg[0], arg[1:]...)
}},
},
}, nil)
})
}

View File

@ -35,5 +35,5 @@ func init() {
})
}},
},
}, nil)
})
}

View File

@ -50,5 +50,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -8,6 +8,9 @@ import (
"strings"
)
const (
TASK_HASH = "task.hash"
)
const (
INNER = "inner"
)
@ -57,5 +60,5 @@ func init() {
m.PushAction(INNER, mdb.REMOVE)
}},
},
}, nil)
})
}

View File

@ -54,5 +54,5 @@ func init() {
m.Sort(SIGNAL)
}},
},
}, nil)
})
}

View File

@ -72,5 +72,5 @@ func init() {
return
}},
},
}, nil)
})
}

View File

@ -32,5 +32,5 @@ func init() {
m.Cmdy(kit.Keys(value[kit.MDB_TEXT], value[kit.MDB_NAME]), ENGINE, arg[0], arg[1], arg[2], arg[3:])
})
}},
}}, nil)
}})
}

View File

@ -40,16 +40,22 @@ func _hash_select(m *ice.Message, prefix, chain, field, value string) {
value = kit.MDB_RANDOMS
}
fields := _hash_fields(m)
cb := m.Optionv(SELECT_CB)
m.Richs(prefix, chain, value, func(key string, val map[string]interface{}) {
val = kit.GetMeta(val)
if m.Option(FIELDS) == DETAIL {
m.Push(DETAIL, val)
} else {
m.Push(key, val, fields)
switch cb := cb.(type) {
case func(fields []string, value map[string]interface{}):
cb(fields, val)
default:
if m.Option(FIELDS) == DETAIL {
m.Push(DETAIL, val)
} else {
m.Push(key, val, fields)
}
}
})
if m.Option(FIELDS) != DETAIL {
m.Sort(kit.MDB_TIME, "time_r")
m.SortTimeR(kit.MDB_TIME)
}
}
func _hash_modify(m *ice.Message, prefix, chain string, field, value string, arg ...string) {
@ -150,7 +156,7 @@ func _list_select(m *ice.Message, prefix, chain, field, value string) {
}
fields := _list_fields(m)
cb := m.Optionv(SELECT_CB)
m.Grows(prefix, chain, kit.Select(m.Option("cache.field"), field), kit.Select(m.Option("cache.value"), value), func(index int, val map[string]interface{}) {
m.Grows(prefix, chain, kit.Select(m.Option("cache.field"), field), kit.Select(m.Option(CACHE_VALUE), value), func(index int, val map[string]interface{}) {
val = kit.GetMeta(val)
switch cb := cb.(type) {
case func(fields []string, value map[string]interface{}):
@ -162,10 +168,9 @@ func _list_select(m *ice.Message, prefix, chain, field, value string) {
m.Push("", val, fields)
}
}
})
if m.Option(FIELDS) != DETAIL {
m.Sort(kit.MDB_ID, "int_r")
m.SortIntR(kit.MDB_ID)
}
}
func _list_modify(m *ice.Message, prefix, chain string, field, value string, arg ...string) {
@ -412,9 +417,12 @@ const (
CACHE_FILED = "cache.field"
CACHE_VALUE = "cache.value"
CACHE_STATUS = "cache.status"
CACHE_ACTION = "cache.action"
CACHE_BEGIN = "cache.begin"
CACHE_HASH = "cache.hash"
CACHE_CLEAR_ON_EXIT = "cache.clear.on.exit"
)
const MDB = "mdb"

View File

@ -29,5 +29,5 @@ func init() {
m.Cmdy(kit.Keys(value[kit.MDB_TEXT], value[kit.MDB_NAME]), PLUGIN, arg[0], arg[1], kit.Select("", arg, 2))
})
}},
}}, nil)
}})
}

View File

@ -29,5 +29,5 @@ func init() {
m.Cmdy(kit.Keys(value[kit.MDB_TEXT], value[kit.MDB_NAME]), RENDER, arg[0], arg[1], kit.Select("", arg, 2))
})
}},
}}, nil)
}})
}

View File

@ -37,5 +37,5 @@ func init() {
})
}
}},
}}, nil)
}})
}

View File

@ -365,7 +365,11 @@ var Index = &ice.Context{Name: "nfs", Help: "存储模块",
}},
FILE: {Name: "file path auto", Help: "文件", Action: map[string]*ice.Action{
"append": {Name: "append", Help: "追加", Hand: func(m *ice.Message, arg ...string) {
if f, e := os.OpenFile(arg[0], os.O_WRONLY|os.O_APPEND, 0664); m.Assert(e) {
if strings.Contains(arg[0], "/") {
os.MkdirAll(path.Dir(arg[0]), ice.MOD_DIR)
}
if f, e := os.OpenFile(arg[0], os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0664); m.Assert(e) {
defer f.Close()
for _, k := range arg[1:] {
@ -419,7 +423,7 @@ var Index = &ice.Context{Name: "nfs", Help: "存储模块",
for _, file := range kit.Split(m.Option(kit.MDB_FILE), ",") {
func(file string) {
r, w := io.Pipe()
m.Go(func(msg *ice.Message) {
m.Go(func() {
for bio := bufio.NewScanner(r); bio.Scan(); {
m.Grow(TAIL, kit.Keys(kit.MDB_HASH, h), kit.Dict(
kit.MDB_FILE, file, kit.MDB_TEXT, bio.Text(),
@ -428,6 +432,7 @@ var Index = &ice.Context{Name: "nfs", Help: "存储模块",
})
m.Option(cli.CMD_STDOUT, w)
m.Option(cli.CMD_STDERR, w)
m.Option(mdb.CACHE_CLEAR_ON_EXIT, "true")
m.Cmd(cli.DAEMON, "tail", "-n", "0", "-f", file)
}(file)
}

View File

@ -94,5 +94,5 @@ func init() {
m.Cmdy(mdb.SELECT, CHANNEL, kit.Keys(kit.MDB_HASH, arg[0]), mdb.LIST, kit.MDB_ID, arg[1:])
}},
},
}, nil)
})
}

View File

@ -167,5 +167,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -382,5 +382,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -226,5 +226,5 @@ ssh {{.Option "user.name"}}@{{.Option "hostname"}} -p {{.Option "port"}}
m.Cmdy(mdb.SELECT, SERVICE, kit.Keys(kit.MDB_HASH, kit.Hashs(arg[0])), mdb.LIST, kit.MDB_ID, arg[1:])
}},
},
}, nil)
})
}

View File

@ -128,5 +128,5 @@ func init() {
m.Sort(kit.MDB_ID)
}},
},
}, nil)
})
}

View File

@ -101,5 +101,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -86,5 +86,5 @@ func init() {
_host_list(m, kit.Select("", arg, 0))
}},
},
}, nil)
})
}

View File

@ -73,5 +73,5 @@ func init() {
_port_list(m, kit.Select("", arg, 0), kit.Select("", arg, 1))
}},
},
}, nil)
})
}

View File

@ -115,5 +115,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -178,5 +178,5 @@ func init() {
}
})
}},
}}, nil)
}})
}

View File

@ -98,8 +98,8 @@ ish_miss_prepare_install
},
Commands: map[string]*ice.Command{
DREAM: {Name: "dream name path auto 启动", Help: "梦想家", Action: map[string]*ice.Action{
gdb.START: {Name: "start type=worker,server repos", Help: "启动", Hand: func(m *ice.Message, arg ...string) {
_dream_show(m, m.Option(kit.MDB_NAME, path.Base(m.Option(kit.SSH_REPOS))))
gdb.START: {Name: "start type=worker,server repos name", Help: "启动", Hand: func(m *ice.Message, arg ...string) {
_dream_show(m, m.Option(kit.MDB_NAME, kit.Select(path.Base(m.Option(kit.SSH_REPOS)), m.Option(kit.MDB_NAME))))
}},
gdb.STOP: {Name: "stop", Help: "停止", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(SPACE, m.Option(kit.MDB_NAME), "exit", "0")
@ -119,5 +119,5 @@ ish_miss_prepare_install
m.Cmdy(nfs.DIR, arg[1:])
}},
},
}, nil)
})
}

View File

@ -75,7 +75,7 @@ func init() {
m.Sort(kit.MDB_PATH)
}
}},
gdb.START: {Name: "start type=worker,server repos", Help: "启动", Hand: func(m *ice.Message, arg ...string) {
gdb.START: {Name: "start type=worker,server repos name", Help: "启动", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(SPACE, m.Option(ROUTE), DREAM, gdb.START, arg)
}},
gdb.STOP: {Name: "stop", Help: "结束", Hand: func(m *ice.Message, arg ...string) {
@ -150,5 +150,5 @@ func init() {
})
}
}},
}}, nil)
}})
}

View File

@ -136,7 +136,8 @@ func _serve_handle(key string, cmd *ice.Command, msg *ice.Message, w http.Respon
}
// 用户请求
msg.Option("cache.limit", "10")
msg.Option("name", "")
msg.Option(mdb.CACHE_LIMIT, "10")
msg.Option(ice.MSG_OUTPUT, "")
msg.Option(ice.MSG_METHOD, r.Method)
msg.Option(ice.MSG_USERWEB, kit.Select(msg.Conf(SHARE, "meta.domain"), r.Header.Get("Referer")))
@ -306,5 +307,5 @@ func init() {
"/intshell/": {Name: "/intshell/", Help: "脚本", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
m.Render(ice.RENDER_DOWNLOAD, path.Join(m.Conf(SERVE, "meta.intshell.path"), path.Join(arg...)))
}},
}}, nil)
}})
}

View File

@ -148,5 +148,5 @@ func init() {
}
_share_local(m, p)
}},
}}, nil)
}})
}

View File

@ -238,5 +238,5 @@ func init() {
})
}
}},
}}, nil)
}})
}

View File

@ -310,5 +310,5 @@ func init() {
}
})
}},
}}, nil)
}})
}

View File

@ -249,7 +249,7 @@ func init() {
m.Render(kit.Select(ice.RENDER_DOWNLOAD, ice.RENDER_RESULT, m.Append("file") == ""), m.Append("text"))
}
}},
}}, nil)
}})
}
func _story_pull(m *ice.Message, arg ...string) {

View File

@ -50,6 +50,14 @@ const ( // MSG
MSG_ACTIVE = "sess.active"
MSG_METHOD = "sess.method"
)
const (
CONTROL_PAGE = "_page"
PROCESS_REFRESH = "_refresh"
PROCESS_FOLLOW = "_follow"
PROCESS_INNER = "_inner"
PROCESS_FIELD = "_field"
)
const ( // CTX
CTX_FOLLOW = "follow"
CTX_STATUS = "status"

View File

@ -123,5 +123,5 @@ func init() {
_action_show(m, arg[0], arg[1], arg[2], arg[3:]...)
}},
}}, nil)
}})
}

View File

@ -22,5 +22,5 @@ func init() {
kit.Fetch(m.Confv(FOOTER, LEGAL), func(index int, value string) { m.Echo(value) })
}},
},
}, nil)
})
}

View File

@ -46,5 +46,5 @@ func init() {
m.Echo(m.Conf(HEADER, TITLE))
}},
},
}, nil)
})
}

View File

@ -60,5 +60,5 @@ func init() {
m.PushAction("openLocation", mdb.REMOVE)
}},
},
}, nil)
})
}

View File

@ -49,5 +49,5 @@ func init() {
m.PushAction(mdb.REMOVE)
}},
},
}, nil)
})
}

View File

@ -346,5 +346,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -45,5 +45,5 @@ func init() {
m.PushAction(mdb.REMOVE)
}},
},
}, nil)
})
}

View File

@ -6,15 +6,13 @@ import (
)
func init() {
Index.Merge(&ice.Context{
Commands: map[string]*ice.Command{
"/search": {Name: "/search", Help: "搜索引擎", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if arg[0] == mdb.RENDER {
m.Cmdy(m.Space(m.Option(POD)), mdb.RENDER, arg[1:])
return
}
m.Cmdy(m.Space(m.Option(POD)), mdb.SEARCH, arg)
}},
},
}, nil)
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
"/search": {Name: "/search", Help: "搜索引擎", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if arg[0] == mdb.RENDER {
m.Cmdy(m.Space(m.Option(POD)), mdb.RENDER, arg[1:])
return
}
m.Cmdy(m.Space(m.Option(POD)), mdb.SEARCH, arg)
}},
}})
}

View File

@ -111,5 +111,5 @@ field "{{.Option "name"}}" web.code.{{.Option "name"}}.{{.Option "name"}}
}
}},
},
}, nil)
})
}

View File

@ -98,5 +98,5 @@ func init() {
m.Cmdy(m.Optionv("cmd"))
}},
},
}, nil)
})
}

View File

@ -74,5 +74,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -62,5 +62,5 @@ func init() {
m.PushAction(kit.Select(mdb.REMOVE, INNER, len(arg) > 0))
}},
},
}, nil)
})
}

View File

@ -162,5 +162,5 @@ func init() {
),
)},
},
}, nil)
})
}

View File

@ -149,5 +149,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -186,7 +186,7 @@ func init() {
WEBPACK: {Name: WEBPACK, Help: "webpack", Value: kit.Data(kit.MDB_PATH, "usr/volcanos")},
BINPACK: {Name: BINPACK, Help: "binpack", Value: kit.Data()},
},
}, nil)
})
}
const _pack = `

View File

@ -89,5 +89,5 @@ func init() {
m.Render(ice.RENDER_VOID)
}},
},
}, nil)
})
}

View File

@ -95,7 +95,7 @@ func init() {
m.Cmdy(nfs.DIR, kit.Select("", arg, 0), "time size path link")
}},
},
}, nil)
})
}
var _contexts = kit.Dict(

View File

@ -41,5 +41,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -35,5 +35,5 @@ func init() {
m.Cmdy(INNER, arg)
}},
},
}, nil)
})
}

View File

@ -158,5 +158,5 @@ func init() {
_asset_list(m, kit.Select("", arg, 0), kit.Select("", arg, 1))
}},
},
}, nil)
})
}

View File

@ -32,5 +32,5 @@ func init() {
m.Cmdy(mdb.SELECT, SALARY, "", mdb.HASH, "month", arg)
}},
},
}, nil)
})
}

View File

@ -73,5 +73,5 @@ func init() {
m.Cmd(mdb.SELECT, TASK, "", mdb.ZONE, kit.MDB_FOREACH)
}},
},
}, nil)
})
}

View File

@ -174,5 +174,5 @@ func init() {
_task_list(m, kit.Select("", arg, 0), kit.Select("", arg, 1))
}},
},
}, nil)
})
}

View File

@ -30,5 +30,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -31,5 +31,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -31,5 +31,5 @@ func init() {
m.SortTimeR(kit.MDB_TIME)
}},
},
}, nil)
})
}

View File

@ -469,5 +469,5 @@ func init() {
_word_show(m, arg[0])
}},
},
}, nil)
})
}

View File

@ -72,5 +72,5 @@ func init() {
m.Cmdy(mdb.SELECT, m.Prefix(CACHE), "", mdb.HASH)
}},
},
}, nil)
})
}

View File

@ -59,5 +59,5 @@ func init() {
m.PushAction("删除")
}},
},
}, nil)
})
}

View File

@ -41,5 +41,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -59,5 +59,5 @@ func init() {
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
}},
},
}, nil)
})
}

View File

@ -70,5 +70,5 @@ func init() {
m.Sort(kit.MDB_NAME)
}},
},
}, nil)
})
}

View File

@ -83,5 +83,5 @@ func init() {
m.SortInt(kit.MDB_LINE)
}},
},
}, nil)
})
}

View File

@ -111,5 +111,5 @@ func init() {
m.Sort(kit.MDB_NAME)
}},
},
}, nil)
})
}

View File

@ -143,5 +143,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -19,5 +19,5 @@ func init() {
m.Cmdy(TOTAL, arg)
}},
},
}, nil)
})
}

View File

@ -50,8 +50,13 @@ var Index = &ice.Context{Name: TMUX, Help: "工作台",
)},
},
Commands: map[string]*ice.Command{
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Load() }},
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save() }},
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
m.Load()
m.Watch(web.DREAM_START, m.Prefix(SESSION))
}},
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
m.Save()
}},
TMUX: {Name: "tmux port path auto start build download", Help: "服务", Action: map[string]*ice.Action{
web.DOWNLOAD: {Name: "download", Help: "下载", Hand: func(m *ice.Message, arg ...string) {
@ -156,6 +161,9 @@ var Index = &ice.Context{Name: TMUX, Help: "工作台",
m.PushAction(mdb.REMOVE)
}},
SESSION: {Name: "session session window pane cmd auto create script", Help: "会话管理", Action: map[string]*ice.Action{
web.DREAM_START: {Name: "dream.start type name share river", Help: "梦想", Hand: func(m *ice.Message, arg ...string) {
m.Cmd(m.Prefix(SESSION), mdb.CREATE)
}},
mdb.CREATE: {Name: "create name", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
m.Option(cli.CMD_ENV, "TMUX", "")
if m.Option(PANE) != "" {

View File

@ -82,5 +82,5 @@ func init() {
})
}},
},
}, nil)
})
}

View File

@ -64,5 +64,5 @@ func init() {
m.Cmd(mdb.INSERT, m.Prefix(INPUT), "", mdb.LIST, kit.MDB_TYPE, "wubi", kit.MDB_NAME, arg[0], kit.MDB_TEXT, m.Result())
}},
},
}, nil)
})
}

View File

@ -86,5 +86,5 @@ func init() {
m.Render(ice.RENDER_RESULT)
}},
},
}, nil)
})
}

View File

@ -54,5 +54,5 @@ func init() {
"pwd", m.Option("pwd"), "buf", m.Option("buf"), "row", m.Option("row"), "col", m.Option("col"))
}},
},
}, nil)
})
}

View File

@ -34,5 +34,5 @@ func init() {
m.Cmdy(code.INSTALL, path.Base(m.Conf(BASH, kit.META_SOURCE)), arg)
}},
},
}, nil)
})
}

View File

@ -37,5 +37,5 @@ func init() {
m.Echo("size: %s\n", msg.Append("size"))
}},
},
}, nil)
})
}

View File

@ -74,5 +74,5 @@ func init() {
m.Cmdy(m.Prefix(FAVOR)).Table()
}},
},
}, nil)
})
}

View File

@ -104,5 +104,5 @@ func init() {
m.Info("trans: %v", m.Result())
}},
},
}, nil)
})
}

View File

@ -71,5 +71,5 @@ func init() {
m.Echo(m.Option(SID))
}},
},
}, nil)
})
}

View File

@ -68,5 +68,5 @@ func init() {
}
}},
},
}, nil)
})
}

View File

@ -54,5 +54,5 @@ func init() {
"size", m.Option("size"), "from", m.Option("from"), "to", m.Option("to"))
}},
},
}, nil)
})
}

View File

@ -143,7 +143,7 @@ func (c *Context) Register(s *Context, x Server, name ...string) *Context {
for _, n := range name {
Name(n, s)
}
s.Merge(s, x)
s.Merge(s)
if c.contexts == nil {
c.contexts = map[string]*Context{}
@ -154,7 +154,7 @@ func (c *Context) Register(s *Context, x Server, name ...string) *Context {
s.server = x
return s
}
func (c *Context) Merge(s *Context, x Server) *Context {
func (c *Context) Merge(s *Context) *Context {
if c.Commands == nil {
c.Commands = map[string]*Command{}
}
@ -195,8 +195,6 @@ func (c *Context) Merge(s *Context, x Server) *Context {
for k, v := range s.Caches {
c.Caches[k] = v
}
s.server = x
return c
}
func (c *Context) _split(name string) []interface{} {