mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 10:35:59 +08:00
feat: use robot to migrate code
Signed-off-by: kubbot & kubecub <3293172751ysy@gmail.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package cmd
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
type ApiCmd struct {
|
||||
*RootCmd
|
||||
}
|
||||
|
||||
func NewApiCmd() *ApiCmd {
|
||||
return &ApiCmd{NewRootCmd("api")}
|
||||
}
|
||||
|
||||
func (a *ApiCmd) AddApi(f func(port int) error) {
|
||||
a.Command.RunE = func(cmd *cobra.Command, args []string) error {
|
||||
return f(a.getPortFlag(cmd))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user