goTools

create some tools use go lang.

Github星跟踪图

goTools

create some tools use go lang.

  1. mysql exporter
  2. ip spider

1. mysql exporter

a tool can export mysql's table,data,views,function & stored procedure together or independent.

characteristic

  • can export table, data, views, funcs.
  • multi grountinue to export many database together.
  • filter \xfffd.
  • solve the dependence of views.
  • can recieve a cli arg, which must be in table, data, view(s) & func, to export single content.

configs.json

you must create configs.json as:

{
    "db_name1": {
        "db_host": "192.168.1.8",
        "db_port": 3306,
        "db_user": "root",
        "db_pass": "123456",
        "db_name": "name1",
        "db_charset": "utf8mb4",
        "file_alias": "file name1"
    },
    "db_name2": {
        "db_host": "localhost",
        "db_port": 3306,
        "db_user": "root",
        "db_pass": "123456",
        "db_name": "name2",
        "db_charset": "utf8mb4"
    },
    "database_dialect": "mysql",
    "workDir": "/home/zhoutk/gocodes/goTools/"
}

Instructions

git clone https://github.com/zhoutk/goTools
cd goTools
go get
go run main.go

go buid main.go
./main                  #export all things of database
./main table            #export tables
./main data             #export tables & data
./main views            #export views
./main funcs            #export funcs & stored procedures

2. ip spider

a tool can spider ip address info from appointed web page.

characteristic

  • multi grountinue to spider web data.
  • write mysql batch.
  • update mysql batch.

sql scripts

you can create table use it:

CREATE TABLE `ip_addr_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '索引,自动增长',
  `ip_addr_begin` varchar(32) NOT NULL DEFAULT '' COMMENT 'ip地址段开始',
  `ip_addr_end` varchar(32) DEFAULT '' COMMENT 'ip地址段结束',
  `province` varchar(32) DEFAULT '' COMMENT '所属省',
  `ip_comp` varchar(32) DEFAULT '' COMMENT '运营商',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ip_addr` (`ip_addr_begin`,`ip_addr_end`)
) ENGINE=InnoDB AUTO_INCREMENT=7268 DEFAULT CHARSET=utf8 COMMENT='表';

Instructions

git clone https://github.com/zhoutk/goTools
cd goTools
go get
go run ip.go

go buid ip.go
./ip 

3. rest server

A framework for building micro service rapidly, safely & efficiently.

characteristic

  • auto orm that can build sql from json object.
  • standard sql interface.
  • auto restful api serivce according to sql struct.

Instructions

git clone https://github.com/zhoutk/goTools
cd goTools
go get
go run bock.go

go buid bock.go
./bock

主要指标

概览
名称与所有者zhoutk/goTools
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2018-06-11 22:38:57
推送于2019-01-21 09:28:02
最后一次提交2019-01-21 17:27:54
发布数3
最新版本名称v1.0.1 (发布于 )
第一版名称untagged-2afbaebfe46d410f915a (发布于 )
用户参与
星数75
关注者数2
派生数23
提交数79
已启用问题?
问题数1
打开的问题数1
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?