add gui support
添加 ui 支持
This commit is contained in:
@@ -1,12 +1,16 @@
|
|||||||
base:
|
base:
|
||||||
is_dev : false
|
is_dev : false
|
||||||
out_dir : ./model # 输出目录
|
out_dir : ./model # 输出目录
|
||||||
|
url_tag : json # web url tag(json,db(https://github.com/google/go-querystring))
|
||||||
|
language : 中 文 # 语言(English,中 文)
|
||||||
|
db_tag : gorm # 数据库标签(gorm,db)
|
||||||
singular_table : false # 单表模式:true:禁用表名复数,false:采用表明复数 参考:gorm.SingularTable
|
singular_table : false # 单表模式:true:禁用表名复数,false:采用表明复数 参考:gorm.SingularTable
|
||||||
simple : false # 简单输出(默认gorm标签不输出)
|
simple : false # 简单输出(默认gorm标签不输出)
|
||||||
is_out_sql : false # 是否输出 sql 原信息
|
is_out_sql : false # 是否输出 sql 原信息
|
||||||
is_out_func : true # 是否输出 快捷函数
|
is_out_func : true # 是否输出 快捷函数
|
||||||
is_json_tag : true # 是否打json标记
|
is_json_tag : true # 是否打json标记
|
||||||
is_foreign_key : true # 是否导出外键关联
|
is_foreign_key : true # 是否导出外键关联
|
||||||
|
is_gui : false # 是否ui模式显示
|
||||||
mysql_info:
|
mysql_info:
|
||||||
host : 127.0.0.1
|
host : 127.0.0.1
|
||||||
port : 3306
|
port : 3306
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ var outDir string
|
|||||||
var singularTable bool
|
var singularTable bool
|
||||||
var foreignKey bool
|
var foreignKey bool
|
||||||
var funcKey bool
|
var funcKey bool
|
||||||
|
var ui bool
|
||||||
|
var urlTag string
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "main",
|
Use: "main",
|
||||||
@@ -64,6 +66,12 @@ func init() {
|
|||||||
rootCmd.PersistentFlags().BoolVarP(&funcKey, "fun", "F", false, "是否导出函数")
|
rootCmd.PersistentFlags().BoolVarP(&funcKey, "fun", "F", false, "是否导出函数")
|
||||||
rootCmd.MarkFlagRequired("func export")
|
rootCmd.MarkFlagRequired("func export")
|
||||||
|
|
||||||
|
rootCmd.PersistentFlags().BoolVarP(&ui, "gui", "g", false, "是否ui显示模式")
|
||||||
|
rootCmd.MarkFlagRequired("show on gui")
|
||||||
|
|
||||||
|
rootCmd.PersistentFlags().StringVarP(&urlTag, "url", "l", "", "url标签(json,url)")
|
||||||
|
rootCmd.MarkFlagRequired("url tag")
|
||||||
|
|
||||||
rootCmd.Flags().IntVar(&mysqlInfo.Port, "port", 3306, "端口号")
|
rootCmd.Flags().IntVar(&mysqlInfo.Port, "port", 3306, "端口号")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,6 +108,9 @@ func MergeMysqlDbInfo() {
|
|||||||
if len(mysqlInfo.Username) > 0 {
|
if len(mysqlInfo.Username) > 0 {
|
||||||
tmp.Username = mysqlInfo.Username
|
tmp.Username = mysqlInfo.Username
|
||||||
}
|
}
|
||||||
|
if len(urlTag) > 0 {
|
||||||
|
config.SetURLTag(urlTag)
|
||||||
|
}
|
||||||
|
|
||||||
config.SetMysqlDbInfo(&tmp)
|
config.SetMysqlDbInfo(&tmp)
|
||||||
|
|
||||||
@@ -118,4 +129,9 @@ func MergeMysqlDbInfo() {
|
|||||||
if funcKey {
|
if funcKey {
|
||||||
config.SetIsOutFunc(funcKey)
|
config.SetIsOutFunc(funcKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ui {
|
||||||
|
config.SetIsGUI(ui)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
// Config custom config struct
|
// Config custom config struct
|
||||||
type Config struct {
|
type Config struct {
|
||||||
CfgBase `yaml:"base"`
|
CfgBase `yaml:"base"`
|
||||||
MySQLInfo MysqlDbInfo `yaml:"mysql_info"`
|
MySQLInfo MysqlDbInfo `yaml:"mysql_info"`
|
||||||
OutDir string `yaml:"out_dir"`
|
OutDir string `yaml:"out_dir"`
|
||||||
|
URLTag string `yaml:"url_tag"` // url tag
|
||||||
|
Language string `yaml:"language"` // language
|
||||||
|
DbTag string `yaml:"db_tag"` // 数据库标签(gormt,db)
|
||||||
Simple bool `yaml:"simple"`
|
Simple bool `yaml:"simple"`
|
||||||
IsJSONTag bool `yaml:"is_json_tag"`
|
IsJSONTag bool `yaml:"is_json_tag"`
|
||||||
SingularTable bool `yaml:"singular_table"`
|
SingularTable bool `yaml:"singular_table"`
|
||||||
IsForeignKey bool `yaml:"is_foreign_key"`
|
IsForeignKey bool `yaml:"is_foreign_key"`
|
||||||
IsOutSQL bool `yaml:"is_out_sql"`
|
IsOutSQL bool `yaml:"is_out_sql"`
|
||||||
IsOutFunc bool `yaml:"is_out_func"`
|
IsOutFunc bool `yaml:"is_out_func"`
|
||||||
|
IsGUI bool `yaml:"is_gui"` //
|
||||||
}
|
}
|
||||||
|
|
||||||
// MysqlDbInfo mysql database information. mysql 数据库信息
|
// MysqlDbInfo mysql database information. mysql 数据库信息
|
||||||
@@ -99,3 +105,55 @@ func GetIsOutFunc() bool {
|
|||||||
func SetIsOutFunc(b bool) {
|
func SetIsOutFunc(b bool) {
|
||||||
_map.IsOutFunc = b
|
_map.IsOutFunc = b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetIsGUI if is gui show .
|
||||||
|
func GetIsGUI() bool {
|
||||||
|
return _map.IsGUI
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetIsGUI if is gui show .
|
||||||
|
func SetIsGUI(b bool) {
|
||||||
|
_map.IsGUI = b
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetURLTag get url tag.
|
||||||
|
func GetURLTag() string {
|
||||||
|
if _map.URLTag != "json" && _map.URLTag != "url" {
|
||||||
|
_map.URLTag = "json"
|
||||||
|
}
|
||||||
|
|
||||||
|
return _map.URLTag
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetURLTag set url tag.
|
||||||
|
func SetURLTag(s string) {
|
||||||
|
_map.URLTag = s
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetLG get language tag.
|
||||||
|
func GetLG() string {
|
||||||
|
if _map.Language != "English" && _map.Language != "中 文" {
|
||||||
|
_map.Language = "English"
|
||||||
|
}
|
||||||
|
|
||||||
|
return _map.Language
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetLG set url tag.
|
||||||
|
func SetLG(s string) {
|
||||||
|
_map.Language = s
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDBTag get database tag.
|
||||||
|
func GetDBTag() string {
|
||||||
|
if _map.DbTag != "gorm" && _map.DbTag != "db" {
|
||||||
|
_map.DbTag = "gorm"
|
||||||
|
}
|
||||||
|
|
||||||
|
return _map.DbTag
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDBTag get database tag.
|
||||||
|
func SetDBTag(s string) {
|
||||||
|
_map.DbTag = s
|
||||||
|
}
|
||||||
|
|||||||
@@ -55,3 +55,13 @@ func GetServiceConfig() (name, displayName, desc string) {
|
|||||||
desc = _map.SerciceDesc
|
desc = _map.SerciceDesc
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetIsDev is is dev
|
||||||
|
func GetIsDev() bool {
|
||||||
|
return _map.IsDev
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetIsDev is is dev
|
||||||
|
func SetIsDev(b bool) {
|
||||||
|
_map.IsDev = b
|
||||||
|
}
|
||||||
|
|||||||
7
data/dlg/cmd_darwin.go
Normal file
7
data/dlg/cmd_darwin.go
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package dlg
|
||||||
|
|
||||||
|
import "os/exec"
|
||||||
|
|
||||||
|
func openURL(url string) {
|
||||||
|
exec.Command(`open`, url).Start()
|
||||||
|
}
|
||||||
7
data/dlg/cmd_linux.go
Normal file
7
data/dlg/cmd_linux.go
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package dlg
|
||||||
|
|
||||||
|
import "os/exec"
|
||||||
|
|
||||||
|
func openURL(url string) {
|
||||||
|
exec.Command(`xdg-open`, url).Start()
|
||||||
|
}
|
||||||
7
data/dlg/cmd_windows.go
Normal file
7
data/dlg/cmd_windows.go
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package dlg
|
||||||
|
|
||||||
|
import "os/exec"
|
||||||
|
|
||||||
|
func openURL(url string) {
|
||||||
|
exec.Command(`cmd`, `/c`, `start`, url).Start() // 有GUI调用
|
||||||
|
}
|
||||||
54
data/dlg/common.go
Normal file
54
data/dlg/common.go
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
package dlg
|
||||||
|
|
||||||
|
import "github.com/jroimartin/gocui"
|
||||||
|
|
||||||
|
func division(a int, b float32) int {
|
||||||
|
r := float32(a) / b
|
||||||
|
return (int)(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dlg *menuDetails) nextButton(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
dlg.btnList[dlg.active].UnFocus()
|
||||||
|
dlg.active = (dlg.active + 1) % len(dlg.btnList)
|
||||||
|
menuFocusButton(g)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func menuFocusButton(g *gocui.Gui) {
|
||||||
|
setlog(g, SLocalize(btnLogArr[menuDlg.active]))
|
||||||
|
menuDlg.btnList[menuDlg.active].Focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dlg *menuDetails) prevButton(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
dlg.btnList[dlg.active].UnFocus()
|
||||||
|
if dlg.active == 0 {
|
||||||
|
dlg.active = len(dlg.btnList)
|
||||||
|
}
|
||||||
|
dlg.active--
|
||||||
|
menuFocusButton(g)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dlg *menuDetails) Draw() {
|
||||||
|
for _, b := range dlg.btnList {
|
||||||
|
b.Draw()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// OnDestroy destroy windows
|
||||||
|
func OnDestroy(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
return gocui.ErrQuit
|
||||||
|
}
|
||||||
|
|
||||||
|
func setCurrentViewOnTop(g *gocui.Gui, name string) (*gocui.View, error) {
|
||||||
|
if _, err := g.SetCurrentView(name); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return g.SetViewOnTop(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
func requireValidator(value string) bool {
|
||||||
|
if value == "" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
234
data/dlg/cui.go
Normal file
234
data/dlg/cui.go
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
package dlg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/xxjwxc/public/tools"
|
||||||
|
|
||||||
|
"github.com/xxjwxc/gormt/data/config"
|
||||||
|
|
||||||
|
"github.com/jroimartin/gocui"
|
||||||
|
"github.com/xxjwxc/public/mycui"
|
||||||
|
)
|
||||||
|
|
||||||
|
func nextView(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
nextIndex := (mainIndex + 1) % len(mainViewArr)
|
||||||
|
name := mainViewArr[nextIndex]
|
||||||
|
|
||||||
|
err := setlog(g, "Going from view "+v.Name()+" to "+name)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := g.SetCurrentView(name); err != nil { // 设置选中
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
g.SelFgColor = gocui.ColorGreen // 设置边框颜色
|
||||||
|
g.FgColor = gocui.ColorWhite
|
||||||
|
|
||||||
|
switch name {
|
||||||
|
case _menuDefine:
|
||||||
|
g.Cursor = false // 光标
|
||||||
|
// g.FgColor = gocui.ColorGreen
|
||||||
|
menuDlg.btnList[menuDlg.active].Focus()
|
||||||
|
case _listDefine:
|
||||||
|
g.Cursor = false
|
||||||
|
menuDlg.btnList[menuDlg.active].UnFocus()
|
||||||
|
case _viewDefine:
|
||||||
|
g.Cursor = true
|
||||||
|
menuDlg.btnList[menuDlg.active].UnFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
mainIndex = nextIndex
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func mainLayout(g *gocui.Gui) error {
|
||||||
|
maxX, maxY := g.Size()
|
||||||
|
if v, err := g.SetView("main_title", maxX/2-16, -1, maxX/2+16, 1); err != nil {
|
||||||
|
if err != gocui.ErrUnknownView {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
v.Highlight = true
|
||||||
|
v.SelFgColor = gocui.ColorGreen | gocui.AttrUnderline
|
||||||
|
fmt.Fprintln(v, "https://github.com/xxjwxc/gormt")
|
||||||
|
}
|
||||||
|
|
||||||
|
if v, err := g.SetView(_menuDefine, 0, 1, division(maxX, uiPart[0])-1, division(maxY, uiPart[1])-1); err != nil {
|
||||||
|
if err != gocui.ErrUnknownView {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
v.Title = SLocalize(_menuDefine)
|
||||||
|
// v.Editable = true // 是否可以编辑
|
||||||
|
v.Wrap = true
|
||||||
|
v.Autoscroll = true
|
||||||
|
// g.FgColor = gocui.ColorGreen
|
||||||
|
}
|
||||||
|
|
||||||
|
if v, err := g.SetView(_listDefine, 0, division(maxY, uiPart[1]), division(maxX, uiPart[0])-1, maxY-1); err != nil {
|
||||||
|
if err != gocui.ErrUnknownView {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
v.Title = SLocalize(_listDefine)
|
||||||
|
v.Wrap = true
|
||||||
|
v.Autoscroll = true
|
||||||
|
if _, err := g.SetCurrentView(_menuDefine); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if v, err := g.SetView(_viewDefine, division(maxX, uiPart[0]), 1, maxX-1, maxY-1); err != nil {
|
||||||
|
if err != gocui.ErrUnknownView {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
v.Title = SLocalize(_viewDefine)
|
||||||
|
v.Wrap = true
|
||||||
|
v.Autoscroll = true
|
||||||
|
v.Editable = true
|
||||||
|
}
|
||||||
|
|
||||||
|
nemuLayOut(g) // menuLayOut
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func nemuLayOut(g *gocui.Gui) {
|
||||||
|
menuDlg = &menuDetails{}
|
||||||
|
menuDlg.btnList = append(menuDlg.btnList,
|
||||||
|
mycui.NewButton(g, _run, SLocalize(_run), 0, 2, 3).SetTextColor(gocui.ColorRed|gocui.AttrReverse, gocui.ColorWhite).
|
||||||
|
AddHandler(gocui.KeyArrowUp, menuDlg.prevButton).AddHandler(gocui.KeyArrowDown, menuDlg.nextButton).
|
||||||
|
AddHandler(gocui.KeyEnter, enterRun).AddHandler(gocui.MouseLeft, enterRun))
|
||||||
|
|
||||||
|
menuDlg.btnList = append(menuDlg.btnList,
|
||||||
|
mycui.NewButton(g, _set, SLocalize(_set), 0, 4, 3).
|
||||||
|
AddHandler(gocui.KeyArrowUp, menuDlg.prevButton).AddHandler(gocui.KeyArrowDown, menuDlg.nextButton).
|
||||||
|
AddHandler(gocui.KeyEnter, enterSet).AddHandler(gocui.MouseLeft, enterSet))
|
||||||
|
|
||||||
|
menuDlg.Draw()
|
||||||
|
menuFocusButton(g)
|
||||||
|
}
|
||||||
|
|
||||||
|
func keybindings(g *gocui.Gui) {
|
||||||
|
if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, OnDestroy); err != nil { // 退出事件
|
||||||
|
log.Panicln(err)
|
||||||
|
}
|
||||||
|
if err := g.SetKeybinding("", gocui.KeyTab, gocui.ModNone, nextView); err != nil { // tab next事件
|
||||||
|
log.Panicln(err)
|
||||||
|
}
|
||||||
|
if err := g.SetKeybinding("main_title", gocui.MouseLeft, gocui.ModNone, about); err != nil {
|
||||||
|
log.Panicln(err)
|
||||||
|
}
|
||||||
|
// if err := g.SetKeybinding(_run, gocui.MouseLeft, gocui.ModNone, about); err != nil {
|
||||||
|
// log.Panicln(err)
|
||||||
|
// }
|
||||||
|
// if err := g.SetKeybinding(_set, gocui.MouseLeft, gocui.ModNone, about); err != nil {
|
||||||
|
// log.Panicln(err)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////signal slot ///////////
|
||||||
|
func about(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
openURL("https://github.com/xxjwxc/gormt")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func setlog(g *gocui.Gui, str string) error {
|
||||||
|
logView, err := g.View(_viewDefine)
|
||||||
|
if err == nil {
|
||||||
|
logView.Clear()
|
||||||
|
fmt.Fprintln(logView, str)
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func enterRun(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
setlog(g, "run .... ing")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func enterSet(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
maxX, _ := g.Size()
|
||||||
|
setlog(g, "")
|
||||||
|
// new form
|
||||||
|
form = mycui.NewForm(g, "set_ui", "Sign Up", division(maxX, uiPart[0])+3, 3, 0, 0)
|
||||||
|
|
||||||
|
// add input field
|
||||||
|
form.AddInputField("out_dir", SLocalize("out_dir"), formPart[0], formPart[1]).SetText(config.GetOutDir()).
|
||||||
|
AddValidate("required input", requireValidator)
|
||||||
|
form.AddInputField("db_host", SLocalize("db_host"), formPart[0], formPart[1]).SetText(config.GetMysqlDbInfo().Host).
|
||||||
|
AddValidate("required input", requireValidator)
|
||||||
|
form.AddInputField("db_port", SLocalize("db_port"), formPart[0], formPart[1]).SetText(tools.AsString(config.GetMysqlDbInfo().Port)).
|
||||||
|
AddValidate("required input", requireValidator)
|
||||||
|
form.AddInputField("db_usename", SLocalize("db_usename"), formPart[0], formPart[1]).SetText(config.GetMysqlDbInfo().Username).
|
||||||
|
AddValidate("required input", requireValidator)
|
||||||
|
form.AddInputField("db_pwd", SLocalize("db_pwd"), formPart[0], formPart[1]).SetText(config.GetMysqlDbInfo().Password).
|
||||||
|
SetMask().SetMaskKeybinding(gocui.KeyCtrlA).
|
||||||
|
AddValidate("required input", requireValidator)
|
||||||
|
form.AddInputField("db_name", SLocalize("db_name"), formPart[0], formPart[1]).SetText(config.GetMysqlDbInfo().Database).
|
||||||
|
AddValidate("required input", requireValidator)
|
||||||
|
|
||||||
|
// add select
|
||||||
|
form.AddSelect("is_dev", SLocalize("is_dev"), formPart[0], formPart[2]).
|
||||||
|
AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetIsDev())))
|
||||||
|
form.AddSelect("is_simple", SLocalize("is_simple"), formPart[0], formPart[2]).
|
||||||
|
AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetSimple())))
|
||||||
|
form.AddSelect("is_singular", SLocalize("is_singular"), formPart[0], formPart[2]).
|
||||||
|
AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetSingularTable())))
|
||||||
|
form.AddSelect("is_out_sql", SLocalize("is_out_sql"), formPart[0], formPart[2]).
|
||||||
|
AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetIsOutSQL())))
|
||||||
|
form.AddSelect("is_out_func", SLocalize("is_out_func"), formPart[0], formPart[2]).
|
||||||
|
AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetIsOutFunc())))
|
||||||
|
form.AddSelect("is_foreign_key", SLocalize("is_foreign_key"), formPart[0], formPart[2]).
|
||||||
|
AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetIsForeignKey())))
|
||||||
|
form.AddSelect("url_tag", SLocalize("url_tag"), formPart[0], formPart[2]).
|
||||||
|
AddOptions("json", "url").SetSelected(tools.AsString(config.GetURLTag()))
|
||||||
|
form.AddSelect("db_tag", SLocalize("db_tag"), formPart[0], formPart[2]).
|
||||||
|
AddOptions("gorm", "db").SetSelected(config.GetDBTag())
|
||||||
|
form.AddSelect("language", SLocalize("language"), formPart[0], formPart[2]).
|
||||||
|
AddOptions("English", "中 文").SetSelected(config.GetLG())
|
||||||
|
|
||||||
|
// add button
|
||||||
|
form.AddButton("save", SLocalize("save"), buttonSave).AddHandler(gocui.MouseLeft, buttonSave)
|
||||||
|
form.AddButton("cancel", SLocalize("cancel"), buttonCancel).AddHandler(gocui.MouseLeft, buttonCancel)
|
||||||
|
|
||||||
|
form.Draw()
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func buttonCancel(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
menuFocusButton(g)
|
||||||
|
if form != nil {
|
||||||
|
return form.Close(g, nil)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func buttonSave(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////
|
||||||
|
|
||||||
|
// OnInitDialog init main loop
|
||||||
|
func OnInitDialog() {
|
||||||
|
g, err := gocui.NewGui(gocui.OutputNormal)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Panicln(err)
|
||||||
|
}
|
||||||
|
defer g.Close()
|
||||||
|
|
||||||
|
g.Cursor = false // 光标
|
||||||
|
g.Mouse = true
|
||||||
|
g.Highlight = true
|
||||||
|
g.SelFgColor = gocui.ColorGreen // 设置边框颜色
|
||||||
|
|
||||||
|
mainLayout(g)
|
||||||
|
//g.SetManagerFunc(mainLayout) // 主布局
|
||||||
|
keybindings(g)
|
||||||
|
|
||||||
|
if err := g.MainLoop(); err != nil && err != gocui.ErrQuit { // 主循环
|
||||||
|
log.Panicln(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
31
data/dlg/def.go
Normal file
31
data/dlg/def.go
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package dlg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/xxjwxc/public/mycui"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
_menuDefine = "menu"
|
||||||
|
_listDefine = "list"
|
||||||
|
_viewDefine = "view"
|
||||||
|
_run = "run"
|
||||||
|
_set = "set"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
uiPart = []float32{4, 3} // x,y 对应列表
|
||||||
|
mainViewArr = []string{_menuDefine, _listDefine, _viewDefine} // 主菜单列表
|
||||||
|
mainIndex = 0
|
||||||
|
|
||||||
|
btnLogArr = []string{"log_run", "log_set"} // 主菜单列表
|
||||||
|
formPart = []int{14, 28, 10}
|
||||||
|
)
|
||||||
|
|
||||||
|
// menu 内容
|
||||||
|
type menuDetails struct {
|
||||||
|
active int
|
||||||
|
btnList []*mycui.Button
|
||||||
|
}
|
||||||
|
|
||||||
|
var menuDlg *menuDetails
|
||||||
|
var form *mycui.Form
|
||||||
186
data/dlg/i18n.go
Normal file
186
data/dlg/i18n.go
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
package dlg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||||
|
"github.com/xxjwxc/public/myi18n"
|
||||||
|
"golang.org/x/text/language"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
Internationalization 国际化
|
||||||
|
*/
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
addChinese()
|
||||||
|
addEnglish()
|
||||||
|
myi18n.SetLocalLG("zh") // default
|
||||||
|
}
|
||||||
|
|
||||||
|
// SLocalize 获取值
|
||||||
|
func SLocalize(ID string) string {
|
||||||
|
return myi18n.Get(ID)
|
||||||
|
}
|
||||||
|
|
||||||
|
func addChinese() error {
|
||||||
|
return myi18n.AddMessages(language.Chinese, &i18n.Message{
|
||||||
|
ID: "menu",
|
||||||
|
Other: "菜单",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "list",
|
||||||
|
Other: "列表",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "view",
|
||||||
|
Other: "视图",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "run",
|
||||||
|
Other: "执 行 ⏯ ",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "set",
|
||||||
|
Other: "设 置 🛠 ",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "out_dir",
|
||||||
|
Other: " 输 出 目 录 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_host",
|
||||||
|
Other: " 数 据 库 地 址 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_port",
|
||||||
|
Other: " 数 据 库 端 口 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_usename",
|
||||||
|
Other: " 数 据 库 用 户 名 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_pwd",
|
||||||
|
Other: " 数 据 库 密 码:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_name",
|
||||||
|
Other: " 数 据 库 名 字 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_dev",
|
||||||
|
Other: " 开 发 模 式:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_singular",
|
||||||
|
Other: " 单 表 模 式 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_simple",
|
||||||
|
Other: " 简 单 输 出 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_out_sql",
|
||||||
|
Other: " 输 出 sql 原 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_out_func",
|
||||||
|
Other: " 输 出 快 捷 函 数 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_foreign_key",
|
||||||
|
Other: " 导 出 外 键 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "url_tag",
|
||||||
|
Other: " web 标 签:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_tag",
|
||||||
|
Other: " 数 据 库 标 签 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "language",
|
||||||
|
Other: " 语 言 :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "true",
|
||||||
|
Other: " 是",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "false",
|
||||||
|
Other: " 否",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "save",
|
||||||
|
Other: " 保 存 ",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "cancel",
|
||||||
|
Other: " 取 消 ",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "log_run",
|
||||||
|
Other: " Enter : 执 行 \n ↑ ↓: 本 视 图 选 择 \n Tab : 多 视 图 切 换 \n 支 持 鼠 标 操 作 方 式 \n \n \033[33;7m 输 入 Enter 直 接 执 行 \033[0m\n ",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "log_set",
|
||||||
|
Other: " Enter : 执 行 \n ↑ ↓: 本 视 图 选 择 \n Tab : 多 视 图 切 换 \n 支 持 鼠 标 操 作 方 式 \n \n \033[33;7m 输 入 Enter 打 开 设 置 窗 口 \033[0m\n ",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func addEnglish() error {
|
||||||
|
return myi18n.AddMessages(language.English, &i18n.Message{
|
||||||
|
ID: "menu",
|
||||||
|
Other: "Menu",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "list",
|
||||||
|
Other: "List",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "view",
|
||||||
|
Other: "View",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "run",
|
||||||
|
Other: "Run ⏯ ",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "set",
|
||||||
|
Other: "Set 🛠 ",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "out_dir",
|
||||||
|
Other: "out dir:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_host",
|
||||||
|
Other: "db host:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_port",
|
||||||
|
Other: "db port:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_usename",
|
||||||
|
Other: "db username:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_pwd",
|
||||||
|
Other: "db password:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_name",
|
||||||
|
Other: "db name:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_dev",
|
||||||
|
Other: "is dev:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_simple",
|
||||||
|
Other: "is simple :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_singular",
|
||||||
|
Other: "is singular :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_out_sql",
|
||||||
|
Other: "is out sql :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_out_func",
|
||||||
|
Other: "is out func :",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "is_foreign_key",
|
||||||
|
Other: "is foreign key:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "url_tag",
|
||||||
|
Other: "url tag:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "db_tag",
|
||||||
|
Other: "db tag:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "language",
|
||||||
|
Other: "Language:",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "true",
|
||||||
|
Other: "true",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "false",
|
||||||
|
Other: "false",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "save",
|
||||||
|
Other: "Save",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "cancel",
|
||||||
|
Other: "Cancel",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "log_run",
|
||||||
|
Other: " Enter : run \n ↑ ↓: Selection of this view \n Tab : Multi view switching \n Mouse operation supported \n \n \033[33;7m Enter to execute \033[0m",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "log_set",
|
||||||
|
Other: " Enter : run \n ↑ ↓: Selection of this view \n Tab : Multi view switching \n Mouse operation supported \n \n \033[33;7m Enter enter to open the settings window \033[0m",
|
||||||
|
})
|
||||||
|
}
|
||||||
6
data/dlg/mycui.go
Normal file
6
data/dlg/mycui.go
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package dlg
|
||||||
|
|
||||||
|
// WinMain windows main loop
|
||||||
|
func WinMain() {
|
||||||
|
OnInitDialog()
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
|
"github.com/xxjwxc/gormt/data/dlg"
|
||||||
"github.com/xxjwxc/gormt/data/view/model"
|
"github.com/xxjwxc/gormt/data/view/model"
|
||||||
|
|
||||||
"github.com/xxjwxc/gormt/data/config"
|
"github.com/xxjwxc/gormt/data/config"
|
||||||
@@ -13,7 +14,15 @@ import (
|
|||||||
|
|
||||||
// Execute exe the cmd
|
// Execute exe the cmd
|
||||||
func Execute() {
|
func Execute() {
|
||||||
|
if config.GetIsGUI() {
|
||||||
|
dlg.WinMain()
|
||||||
|
} else {
|
||||||
|
showCmd()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func showCmd() {
|
||||||
// var tt oauth_db.UserInfoTbl
|
// var tt oauth_db.UserInfoTbl
|
||||||
// tt.Nickname = "ticket_001"
|
// tt.Nickname = "ticket_001"
|
||||||
// orm.Where("nickname = ?", "ticket_001").Find(&tt)
|
// orm.Where("nickname = ?", "ticket_001").Find(&tt)
|
||||||
|
|||||||
5
go.mod
5
go.mod
@@ -7,10 +7,13 @@ require (
|
|||||||
github.com/go-playground/universal-translator v0.17.0 // indirect
|
github.com/go-playground/universal-translator v0.17.0 // indirect
|
||||||
github.com/go-sql-driver/mysql v1.4.1
|
github.com/go-sql-driver/mysql v1.4.1
|
||||||
github.com/jinzhu/gorm v1.9.11
|
github.com/jinzhu/gorm v1.9.11
|
||||||
|
github.com/jroimartin/gocui v0.4.0
|
||||||
github.com/kr/pretty v0.1.0 // indirect
|
github.com/kr/pretty v0.1.0 // indirect
|
||||||
github.com/leodido/go-urn v1.2.0 // indirect
|
github.com/leodido/go-urn v1.2.0 // indirect
|
||||||
|
github.com/nicksnyder/go-i18n/v2 v2.0.3
|
||||||
github.com/spf13/cobra v0.0.5
|
github.com/spf13/cobra v0.0.5
|
||||||
github.com/xxjwxc/public v0.0.0-20191107073037-ea6b812d567f
|
github.com/xxjwxc/public v0.0.0-20200120133922-c61314a90a4a
|
||||||
|
golang.org/x/text v0.3.2
|
||||||
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
||||||
gopkg.in/go-playground/validator.v9 v9.30.2
|
gopkg.in/go-playground/validator.v9 v9.30.2
|
||||||
gopkg.in/yaml.v2 v2.2.7
|
gopkg.in/yaml.v2 v2.2.7
|
||||||
|
|||||||
24
go.sum
24
go.sum
@@ -2,6 +2,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
|||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
|
cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
|
||||||
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
|
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
|
||||||
|
github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||||
@@ -70,6 +71,8 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD
|
|||||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||||
github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
|
github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
|
||||||
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||||
|
github.com/jroimartin/gocui v0.4.0 h1:52jnalstgmc25FmtGcWqa0tcbMEWS6RpFLsOIO+I+E8=
|
||||||
|
github.com/jroimartin/gocui v0.4.0/go.mod h1:7i7bbj99OgFHzo7kB2zPb8pXLqMBSQegY7azfqXMkyY=
|
||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||||
github.com/kardianos/service v1.0.1-0.20191017145738-4df36c9fc1c6/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo=
|
github.com/kardianos/service v1.0.1-0.20191017145738-4df36c9fc1c6/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo=
|
||||||
@@ -84,12 +87,21 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx
|
|||||||
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
|
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
|
||||||
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
|
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
|
||||||
|
github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0=
|
||||||
|
github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||||
github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q=
|
github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q=
|
||||||
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
|
github.com/nicksnyder/go-i18n v2.0.3+incompatible h1:XCCaWsCoy4KlWkhOr+63dkv6oJmitJ573uJqDBAiFiQ=
|
||||||
|
github.com/nicksnyder/go-i18n/v2 v2.0.3 h1:ks/JkQiOEhhuF6jpNvx+Wih1NIiXzUnZeZVnJuI8R8M=
|
||||||
|
github.com/nicksnyder/go-i18n/v2 v2.0.3/go.mod h1:oDab7q8XCYMRlcrBnaY/7B1eOectbvj6B1UPBT+p5jo=
|
||||||
|
github.com/nsf/termbox-go v0.0.0-20191229070316-58d4fcbce2a7 h1:OkWEy7aQeQTbgdrcGi9bifx+Y6bMM7ae7y42hDFaBvA=
|
||||||
|
github.com/nsf/termbox-go v0.0.0-20191229070316-58d4fcbce2a7/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
|
||||||
|
github.com/olivere/elastic v6.2.26+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8=
|
||||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||||
@@ -97,6 +109,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ
|
|||||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||||
@@ -126,12 +139,16 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT
|
|||||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||||
github.com/xxjwxc/public v0.0.0-20191107073037-ea6b812d567f h1:PyaqoUhjkgpBGR/8LXWvk3yzrILMXC7Ygu8xhl5+sM8=
|
github.com/xxjwxc/public v0.0.0-20191107073037-ea6b812d567f h1:PyaqoUhjkgpBGR/8LXWvk3yzrILMXC7Ygu8xhl5+sM8=
|
||||||
github.com/xxjwxc/public v0.0.0-20191107073037-ea6b812d567f/go.mod h1:j0CCXMUDtykGMfOoBpy1pfmzEeBk2JVusosjbgjfMZg=
|
github.com/xxjwxc/public v0.0.0-20191107073037-ea6b812d567f/go.mod h1:j0CCXMUDtykGMfOoBpy1pfmzEeBk2JVusosjbgjfMZg=
|
||||||
|
github.com/xxjwxc/public v0.0.0-20200120133922-c61314a90a4a h1:sQ+O2UwDj1ShdZ6NLgp98cmaZLWrkFpVJB+wOzj1kDQ=
|
||||||
|
github.com/xxjwxc/public v0.0.0-20200120133922-c61314a90a4a/go.mod h1:UYQUNNJmUzNKpjY5ctz1n/XoJonmhAIgD51zS2rEsek=
|
||||||
|
github.com/xxjwxc/public v0.0.0-20200120153226-f36cf754df21 h1:1OF0Q6FGQhmziN4yvHLiF9XXOqfChL5z4rcogSQqCos=
|
||||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
|
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
|
||||||
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
@@ -144,12 +161,15 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r
|
|||||||
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@@ -158,9 +178,12 @@ golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5h
|
|||||||
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
@@ -168,6 +191,7 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
|
|||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
|||||||
Reference in New Issue
Block a user